mingw: fix format string warnings

pull/5533/head
Victor Julien 6 years ago
parent 606750f2a0
commit 0eb692e500

@ -560,8 +560,7 @@ typedef struct RuleAnalyzer {
JsonBuilder *js_notes; JsonBuilder *js_notes;
} RuleAnalyzer; } RuleAnalyzer;
static void __attribute__ ((format (printf, 2, 3))) static void ATTR_FMT_PRINTF(2, 3) AnalyzerNote(RuleAnalyzer *ctx, char *fmt, ...)
AnalyzerNote(RuleAnalyzer *ctx, char *fmt, ...)
{ {
va_list ap; va_list ap;
char str[1024]; char str[1024];
@ -576,8 +575,7 @@ AnalyzerNote(RuleAnalyzer *ctx, char *fmt, ...)
jb_append_string(ctx->js_notes, str); jb_append_string(ctx->js_notes, str);
} }
static void __attribute__ ((format (printf, 2, 3))) static void ATTR_FMT_PRINTF(2, 3) AnalyzerWarning(RuleAnalyzer *ctx, char *fmt, ...)
AnalyzerWarning(RuleAnalyzer *ctx, char *fmt, ...)
{ {
va_list ap; va_list ap;
char str[1024]; char str[1024];

@ -388,7 +388,9 @@ typedef unsigned char u_char
#define WARN_UNUSED __attribute__((warn_unused_result)) #define WARN_UNUSED __attribute__((warn_unused_result))
#if defined(__GNUC__) #if defined(__MINGW32__)
#define ATTR_FMT_PRINTF(x, y) __attribute__((format(__MINGW_PRINTF_FORMAT, (x), (y))))
#elif defined(__GNUC__)
#define ATTR_FMT_PRINTF(x, y) __attribute__((format(printf, (x), (y)))) #define ATTR_FMT_PRINTF(x, y) __attribute__((format(printf, (x), (y))))
#else #else
#define ATTR_FMT_PRINTF(x, y) #define ATTR_FMT_PRINTF(x, y)

Loading…
Cancel
Save