From 3d77e217b2b97d2c290c50c4dc55987ecc13eb79 Mon Sep 17 00:00:00 2001 From: Julian Waters Date: Wed, 15 Mar 2023 13:34:48 +0000 Subject: [PATCH] 8301308: Remove version conditionalization for gcc/clang PRAGMA_DIAG_PUSH/POP Reviewed-by: kbarrett, dholmes --- .../share/utilities/compilerWarnings_gcc.hpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/hotspot/share/utilities/compilerWarnings_gcc.hpp b/src/hotspot/share/utilities/compilerWarnings_gcc.hpp index 99c2f174836..3cfbd0326e7 100644 --- a/src/hotspot/share/utilities/compilerWarnings_gcc.hpp +++ b/src/hotspot/share/utilities/compilerWarnings_gcc.hpp @@ -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.