From e3dad43a7dda8be42caf5ccaed4dfe0d51a52cf5 Mon Sep 17 00:00:00 2001 From: Ben Taylor Date: Tue, 18 Jul 2023 20:41:52 +0000 Subject: [PATCH] 8308283: Build failure with GCC12 & GCC13 Reviewed-by: phh Backport-of: bfc3ccd90d579f6cba3a704766b7a1ea56beebe1 --- make/modules/java.desktop/lib/Awt2dLibraries.gmk | 2 +- src/hotspot/share/utilities/compilerWarnings.hpp | 4 ++++ src/hotspot/share/utilities/compilerWarnings_gcc.hpp | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/make/modules/java.desktop/lib/Awt2dLibraries.gmk b/make/modules/java.desktop/lib/Awt2dLibraries.gmk index d87e25152eb..03d6c9c20e5 100644 --- a/make/modules/java.desktop/lib/Awt2dLibraries.gmk +++ b/make/modules/java.desktop/lib/Awt2dLibraries.gmk @@ -464,7 +464,7 @@ else # expansion-to-defined required for GCC 9 builds. Not required for GCC 10+. HARFBUZZ_DISABLED_WARNINGS_CXX_gcc := reorder delete-non-virtual-dtor strict-overflow \ maybe-uninitialized class-memaccess unused-result extra use-after-free noexcept-type \ - expansion-to-defined + expansion-to-defined dangling-reference HARFBUZZ_DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \ tautological-constant-out-of-range-compare int-to-pointer-cast \ undef missing-field-initializers range-loop-analysis \ diff --git a/src/hotspot/share/utilities/compilerWarnings.hpp b/src/hotspot/share/utilities/compilerWarnings.hpp index 85d5f10d994..fb796859b96 100644 --- a/src/hotspot/share/utilities/compilerWarnings.hpp +++ b/src/hotspot/share/utilities/compilerWarnings.hpp @@ -70,4 +70,8 @@ #define PRAGMA_STRINGOP_TRUNCATION_IGNORED #endif +#ifndef PRAGMA_INFINITE_RECURSION_IGNORED +#define PRAGMA_INFINITE_RECURSION_IGNORED +#endif + #endif // SHARE_UTILITIES_COMPILERWARNINGS_HPP diff --git a/src/hotspot/share/utilities/compilerWarnings_gcc.hpp b/src/hotspot/share/utilities/compilerWarnings_gcc.hpp index 69a22a5940b..ecc13dc2b07 100644 --- a/src/hotspot/share/utilities/compilerWarnings_gcc.hpp +++ b/src/hotspot/share/utilities/compilerWarnings_gcc.hpp @@ -38,9 +38,12 @@ #define PRAGMA_DISABLE_GCC_WARNING(option_string) \ PRAGMA_DISABLE_GCC_WARNING_AUX(GCC diagnostic ignored option_string) -// Disable -Wdangling-pointer which is introduced in GCC 12. #if !defined(__clang_major__) && (__GNUC__ >= 12) +// Disable -Wdangling-pointer which is introduced in GCC 12. #define PRAGMA_DANGLING_POINTER_IGNORED PRAGMA_DISABLE_GCC_WARNING("-Wdangling-pointer") + +// Disable -Winfinite-recursion which is introduced in GCC 12. +#define PRAGMA_INFINITE_RECURSION_IGNORED PRAGMA_DISABLE_GCC_WARNING("-Winfinite-recursion") #endif #define PRAGMA_FORMAT_NONLITERAL_IGNORED \