8301308: Remove version conditionalization for gcc/clang PRAGMA_DIAG_PUSH/POP

Reviewed-by: kbarrett, dholmes
This commit is contained in:
Julian Waters 2023-03-15 13:34:48 +00:00
parent e3777b0c49
commit 3d77e217b2

View File

@ -36,6 +36,9 @@
#define PRAGMA_DISABLE_GCC_WARNING(optstring) _Pragma(STR(GCC diagnostic ignored optstring))
#define PRAGMA_DIAG_PUSH _Pragma("GCC diagnostic push")
#define PRAGMA_DIAG_POP _Pragma("GCC diagnostic pop")
#define PRAGMA_FORMAT_NONLITERAL_IGNORED \
PRAGMA_DISABLE_GCC_WARNING("-Wformat-nonliteral") \
PRAGMA_DISABLE_GCC_WARNING("-Wformat-security")
@ -56,16 +59,6 @@
#define PRAGMA_NONNULL_IGNORED PRAGMA_DISABLE_GCC_WARNING("-Wnonnull")
#if defined(__clang_major__) && \
(__clang_major__ >= 4 || \
(__clang_major__ >= 3 && __clang_minor__ >= 1)) || \
((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
// Tested to work with clang version 3.1 and better.
#define PRAGMA_DIAG_PUSH _Pragma("GCC diagnostic push")
#define PRAGMA_DIAG_POP _Pragma("GCC diagnostic pop")
#endif // clang/gcc version check
#if (__GNUC__ >= 10)
// TODO: Re-enable warning attribute for Clang once
// https://github.com/llvm/llvm-project/issues/56519 is fixed and released.