From 64e307936eca7beb8bee0b0b097257dff386f598 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 28 Nov 2019 14:55:29 +0100 Subject: [PATCH] common: add ATTR_FMT_PRINTF wrapper Wraps around __attribute__((format(printf, (x), (y)))) --- src/suricata-common.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/suricata-common.h b/src/suricata-common.h index 6bbd224add..3636517250 100644 --- a/src/suricata-common.h +++ b/src/suricata-common.h @@ -371,6 +371,12 @@ #define WARN_UNUSED __attribute__((warn_unused_result)) +#if defined(__GNUC__) +#define ATTR_FMT_PRINTF(x, y) __attribute__((format(printf, (x), (y)))) +#else +#define ATTR_FMT_PRINTF(x, y) +#endif + #define SCNtohl(x) (uint32_t)ntohl((x)) #define SCNtohs(x) (uint16_t)ntohs((x))