diff --git a/src/detect-engine-analyzer.c b/src/detect-engine-analyzer.c index ff2ebb586064..c44dc5cdfd73 100644 --- a/src/detect-engine-analyzer.c +++ b/src/detect-engine-analyzer.c @@ -560,8 +560,7 @@ typedef struct RuleAnalyzer { JsonBuilder *js_notes; } RuleAnalyzer; -static void __attribute__ ((format (printf, 2, 3))) -AnalyzerNote(RuleAnalyzer *ctx, char *fmt, ...) +static void ATTR_FMT_PRINTF(2, 3) AnalyzerNote(RuleAnalyzer *ctx, char *fmt, ...) { va_list ap; char str[1024]; @@ -576,8 +575,7 @@ AnalyzerNote(RuleAnalyzer *ctx, char *fmt, ...) jb_append_string(ctx->js_notes, str); } -static void __attribute__ ((format (printf, 2, 3))) -AnalyzerWarning(RuleAnalyzer *ctx, char *fmt, ...) +static void ATTR_FMT_PRINTF(2, 3) AnalyzerWarning(RuleAnalyzer *ctx, char *fmt, ...) { va_list ap; char str[1024]; diff --git a/src/suricata-common.h b/src/suricata-common.h index a187730138d4..967849ac91a0 100644 --- a/src/suricata-common.h +++ b/src/suricata-common.h @@ -388,7 +388,9 @@ typedef unsigned char u_char #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)))) #else #define ATTR_FMT_PRINTF(x, y)