diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2020-04-06 16:27:42 +0200 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2020-04-11 14:16:30 +0200 |
commit | 26e2a97b1cbb099fae5a7b613ea1edbb342a4061 (patch) | |
tree | 08b9705d1c1805cf4a536e0835205d15be2136a6 /contrib | |
parent | 765813e908e0f23e98ec6224b0408a152a9d3ec0 (diff) | |
download | rspamd-26e2a97b1cbb099fae5a7b613ea1edbb342a4061.tar.gz rspamd-26e2a97b1cbb099fae5a7b613ea1edbb342a4061.zip |
[Minor] enable Wmissing-format-attribute
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/hiredis/async.h | 6 | ||||
-rw-r--r-- | contrib/hiredis/hiredis.h | 18 | ||||
-rw-r--r-- | contrib/hiredis/sds.h | 3 | ||||
-rw-r--r-- | contrib/librdns/dns_private.h | 3 | ||||
-rw-r--r-- | contrib/librdns/logger.h | 6 | ||||
-rw-r--r-- | contrib/librdns/resolver.c | 6 | ||||
-rw-r--r-- | contrib/replxx/include/replxx.h | 3 | ||||
-rw-r--r-- | contrib/replxx/include/replxx.hxx | 3 | ||||
-rw-r--r-- | contrib/uthash/utstring.h | 3 |
9 files changed, 48 insertions, 3 deletions
diff --git a/contrib/hiredis/async.h b/contrib/hiredis/async.h index 3d20241c6..40a5a49c8 100644 --- a/contrib/hiredis/async.h +++ b/contrib/hiredis/async.h @@ -119,7 +119,13 @@ void redisAsyncHandleWrite(redisAsyncContext *ac); /* Command functions for an async context. Write the command to the * output buffer and register the provided callback. */ +#ifdef __GNUC__ +__attribute__((format(printf, 4, 0))) +#endif int redisvAsyncCommand(redisAsyncContext *ac, redisCallbackFn *fn, void *privdata, const char *format, va_list ap); +#ifdef __GNUC__ +__attribute__((format(printf, 4, 5))) +#endif int redisAsyncCommand(redisAsyncContext *ac, redisCallbackFn *fn, void *privdata, const char *format, ...); int redisAsyncCommandArgv(redisAsyncContext *ac, redisCallbackFn *fn, void *privdata, int argc, const char **argv, const size_t *argvlen); int redisAsyncFormattedCommand(redisAsyncContext *ac, redisCallbackFn *fn, void *privdata, const char *cmd, size_t len); diff --git a/contrib/hiredis/hiredis.h b/contrib/hiredis/hiredis.h index 153bfd7a6..6b531b910 100644 --- a/contrib/hiredis/hiredis.h +++ b/contrib/hiredis/hiredis.h @@ -125,7 +125,13 @@ redisReader *redisReaderCreate(void); void freeReplyObject(void *reply); /* Functions to format a command according to the protocol. */ +#ifdef __GNUC__ +__attribute__((format(printf, 2, 0))) +#endif int redisvFormatCommand(char **target, const char *format, va_list ap); +#ifdef __GNUC__ +__attribute__((format(printf, 2, 3))) +#endif int redisFormatCommand(char **target, const char *format, ...); int redisFormatCommandArgv(char **target, int argc, const char **argv, const size_t *argvlen); int redisFormatSdsCommandArgv(sds *target, int argc, const char ** argv, const size_t *argvlen); @@ -204,7 +210,13 @@ int redisAppendFormattedCommand(redisContext *c, const char *cmd, size_t len); /* Write a command to the output buffer. Use these functions in blocking mode * to get a pipeline of commands. */ +#ifdef __GNUC__ +__attribute__((format(printf, 2, 0))) +#endif int redisvAppendCommand(redisContext *c, const char *format, va_list ap); +#ifdef __GNUC__ +__attribute__((format(printf, 2, 3))) +#endif int redisAppendCommand(redisContext *c, const char *format, ...); int redisAppendCommandArgv(redisContext *c, int argc, const char **argv, const size_t *argvlen); @@ -213,7 +225,13 @@ int redisAppendCommandArgv(redisContext *c, int argc, const char **argv, const s * NULL if there was an error in performing the request, otherwise it will * return the reply. In a non-blocking context, it is identical to calling * only redisAppendCommand and will always return NULL. */ +#ifdef __GNUC__ +__attribute__((format(printf, 2, 0))) +#endif void *redisvCommand(redisContext *c, const char *format, va_list ap); +#ifdef __GNUC__ +__attribute__((format(printf, 2, 3))) +#endif void *redisCommand(redisContext *c, const char *format, ...); void *redisCommandArgv(redisContext *c, int argc, const char **argv, const size_t *argvlen); diff --git a/contrib/hiredis/sds.h b/contrib/hiredis/sds.h index 19a2abd31..a494f2efc 100644 --- a/contrib/hiredis/sds.h +++ b/contrib/hiredis/sds.h @@ -71,6 +71,9 @@ sds sdscatsds(sds s, const sds t); sds sdscpylen(sds s, const char *t, size_t len); sds sdscpy(sds s, const char *t); +#ifdef __GNUC__ +__attribute__((format(printf, 2, 0))) +#endif sds sdscatvprintf(sds s, const char *fmt, va_list ap); #ifdef __GNUC__ sds sdscatprintf(sds s, const char *fmt, ...) diff --git a/contrib/librdns/dns_private.h b/contrib/librdns/dns_private.h index f734e2312..3f0bee437 100644 --- a/contrib/librdns/dns_private.h +++ b/contrib/librdns/dns_private.h @@ -138,6 +138,9 @@ struct rdns_resolver { struct rdns_plugin *curve_plugin; struct rdns_fake_reply *fake_elts; +#ifdef __GNUC__ + __attribute__((format(printf, 4, 0))) +#endif rdns_log_function logger; void *log_data; enum rdns_log_level log_level; diff --git a/contrib/librdns/logger.h b/contrib/librdns/logger.h index f9c33bbe4..80728763e 100644 --- a/contrib/librdns/logger.h +++ b/contrib/librdns/logger.h @@ -26,10 +26,16 @@ #include <stdarg.h> #include "dns_private.h" +#ifdef __GNUC__ +__attribute__((format(printf, 4, 0))) +#endif void rdns_logger_internal (void *log_data, enum rdns_log_level level, const char *function, const char *format, va_list args); +#ifdef __GNUC__ +__attribute__((format(printf, 4, 5))) +#endif void rdns_logger_helper (struct rdns_resolver *resolver, enum rdns_log_level level, const char *function, const char *format, ...); diff --git a/contrib/librdns/resolver.c b/contrib/librdns/resolver.c index aec0e9381..98807f38e 100644 --- a/contrib/librdns/resolver.c +++ b/contrib/librdns/resolver.c @@ -758,14 +758,14 @@ rdns_make_request_full ( type = req->requested_names[i].type; if (queries > 1) { if (!rdns_add_rr (req, cur_name, clen, type, &comp)) { - rdns_err ("cannot add rr", cur_name); + rdns_err ("cannot add rr"); REF_RELEASE (req); rnds_compression_free (comp); return NULL; } } else { if (!rdns_add_rr (req, cur_name, clen, type, NULL)) { - rdns_err ("cannot add rr", cur_name); + rdns_err ("cannot add rr"); REF_RELEASE (req); rnds_compression_free (comp); return NULL; @@ -1125,4 +1125,4 @@ void rdns_resolver_set_fake_reply (struct rdns_resolver *resolver, HASH_ADD (hh, resolver->fake_elts, key, sizeof (*srch) + len, fake_rep); } -}
\ No newline at end of file +} diff --git a/contrib/replxx/include/replxx.h b/contrib/replxx/include/replxx.h index cb1c917b4..4bdad5127 100644 --- a/contrib/replxx/include/replxx.h +++ b/contrib/replxx/include/replxx.h @@ -356,6 +356,9 @@ REPLXX_IMPEXP void replxx_set_state( Replxx*, ReplxxState* state ); * * \param fmt - printf style format. */ +#ifdef __GNUC__ +__attribute__((format(printf, 2, 3))) +#endif REPLXX_IMPEXP int replxx_print( Replxx*, char const* fmt, ... ); /*! \brief Schedule an emulated key press event. diff --git a/contrib/replxx/include/replxx.hxx b/contrib/replxx/include/replxx.hxx index 3fe90e670..1401ea27c 100644 --- a/contrib/replxx/include/replxx.hxx +++ b/contrib/replxx/include/replxx.hxx @@ -370,6 +370,9 @@ public: * * \param fmt - printf style format. */ +#ifdef __GNUC__ + __attribute__((format(printf, 2, 3))) +#endif void print( char const* fmt, ... ); /*! \brief Schedule an emulated key press event. diff --git a/contrib/uthash/utstring.h b/contrib/uthash/utstring.h index f11f34b77..6130fac53 100644 --- a/contrib/uthash/utstring.h +++ b/contrib/uthash/utstring.h @@ -120,6 +120,9 @@ do { \ #define utstring_body(s) ((s)->d) +#ifdef __GNUC__ +__attribute__((format(printf, 2, 0))) +#endif _UNUSED_ static void utstring_printf_va(UT_string *s, const char *fmt, va_list ap) { int n; va_list cp; |