From: Victor Julien Date: Thu, 28 Nov 2019 13:55:29 +0000 (+0100) Subject: common: add ATTR_FMT_PRINTF wrapper X-Git-Tag: suricata-6.0.0-beta1~530 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64e307936eca7beb8bee0b0b097257dff386f598;p=thirdparty%2Fsuricata.git common: add ATTR_FMT_PRINTF wrapper Wraps around __attribute__((format(printf, (x), (y)))) --- 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))