From d645e55545cce517a5e97feca01f43f84dec4a26 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 13 Aug 2017 17:06:53 +0300 Subject: [PATCH] Unified suppression of format warnings for GCC and Clang This disables the following compilation warning reported by Clang: src/p_3dfloors.cpp:1002:24: warning: format specifies type 'char *' but the argument has type 'int' [-Wformat] --- src/zstring.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/zstring.h b/src/zstring.h index 4de4a2ba0..cdb4dc521 100644 --- a/src/zstring.h +++ b/src/zstring.h @@ -46,16 +46,10 @@ #define PRINTFISH(x) #endif -#ifdef __clang__ +#ifdef __GNUC__ #define IGNORE_FORMAT_PRE \ _Pragma("GCC diagnostic push") \ - _Pragma("GCC diagnostic ignored \"-Wformat-invalid-specifier\"") \ - _Pragma("GCC diagnostic ignored \"-Wformat-extra-args\"") -#define IGNORE_FORMAT_POST _Pragma("GCC diagnostic pop") -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 6))) -#define IGNORE_FORMAT_PRE \ - _Pragma("GCC diagnostic push") \ - _Pragma("GCC diagnostic ignored \"-Wformat=\"") \ + _Pragma("GCC diagnostic ignored \"-Wformat\"") \ _Pragma("GCC diagnostic ignored \"-Wformat-extra-args\"") #define IGNORE_FORMAT_POST _Pragma("GCC diagnostic pop") #else