Skip to content

Commit 3d77e21

Browse files
8301308: Remove version conditionalization for gcc/clang PRAGMA_DIAG_PUSH/POP
Reviewed-by: kbarrett, dholmes
1 parent e3777b0 commit 3d77e21

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/hotspot/share/utilities/compilerWarnings_gcc.hpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636

3737
#define PRAGMA_DISABLE_GCC_WARNING(optstring) _Pragma(STR(GCC diagnostic ignored optstring))
3838

39+
#define PRAGMA_DIAG_PUSH _Pragma("GCC diagnostic push")
40+
#define PRAGMA_DIAG_POP _Pragma("GCC diagnostic pop")
41+
3942
#define PRAGMA_FORMAT_NONLITERAL_IGNORED \
4043
PRAGMA_DISABLE_GCC_WARNING("-Wformat-nonliteral") \
4144
PRAGMA_DISABLE_GCC_WARNING("-Wformat-security")
@@ -56,16 +59,6 @@
5659

5760
#define PRAGMA_NONNULL_IGNORED PRAGMA_DISABLE_GCC_WARNING("-Wnonnull")
5861

59-
#if defined(__clang_major__) && \
60-
(__clang_major__ >= 4 || \
61-
(__clang_major__ >= 3 && __clang_minor__ >= 1)) || \
62-
((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
63-
// Tested to work with clang version 3.1 and better.
64-
#define PRAGMA_DIAG_PUSH _Pragma("GCC diagnostic push")
65-
#define PRAGMA_DIAG_POP _Pragma("GCC diagnostic pop")
66-
67-
#endif // clang/gcc version check
68-
6962
#if (__GNUC__ >= 10)
7063
// TODO: Re-enable warning attribute for Clang once
7164
// https://github.com/llvm/llvm-project/issues/56519 is fixed and released.

0 commit comments

Comments
 (0)