Skip to content

Commit

Permalink
8308283: Build failure with GCC12 & GCC13
Browse files Browse the repository at this point in the history
Reviewed-by: phh
Backport-of: bfc3ccd90d579f6cba3a704766b7a1ea56beebe1
  • Loading branch information
Ben Taylor authored and Paul Hohensee committed Jul 18, 2023
1 parent 0dd98fd commit e3dad43
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion make/modules/java.desktop/lib/Awt2dLibraries.gmk
Expand Up @@ -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 \
Expand Down
4 changes: 4 additions & 0 deletions src/hotspot/share/utilities/compilerWarnings.hpp
Expand Up @@ -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
5 changes: 4 additions & 1 deletion src/hotspot/share/utilities/compilerWarnings_gcc.hpp
Expand Up @@ -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 \
Expand Down

1 comment on commit e3dad43

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.