Skip to content

Commit

Permalink
8308283: Build failure with GCC12 & GCC13
Browse files Browse the repository at this point in the history
Reviewed-by: erikj, jiefu
  • Loading branch information
bobpengxie authored and DamonFool committed May 18, 2023
1 parent 57b8ed1 commit bfc3ccd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion make/modules/java.desktop/lib/Awt2dLibraries.gmk
Expand Up @@ -456,7 +456,7 @@ else
unused-result array-bounds
# noexcept-type required for GCC 7 builds. Not required for GCC 8+.
# expansion-to-defined required for GCC 9 builds. Not required for GCC 10+.
HARFBUZZ_DISABLED_WARNINGS_CXX_gcc := class-memaccess noexcept-type expansion-to-defined
HARFBUZZ_DISABLED_WARNINGS_CXX_gcc := class-memaccess noexcept-type expansion-to-defined dangling-reference
HARFBUZZ_DISABLED_WARNINGS_clang := missing-field-initializers range-loop-analysis
HARFBUZZ_DISABLED_WARNINGS_microsoft := 4267 4244

Expand Down
4 changes: 4 additions & 0 deletions src/hotspot/share/utilities/compilerWarnings.hpp
Expand Up @@ -74,6 +74,10 @@
#define PRAGMA_STRINGOP_OVERFLOW_IGNORED
#endif

#ifndef PRAGMA_INFINITE_RECURSION_IGNORED
#define PRAGMA_INFINITE_RECURSION_IGNORED
#endif

#ifndef PRAGMA_NONNULL_IGNORED
#define PRAGMA_NONNULL_IGNORED
#endif
Expand Down
5 changes: 4 additions & 1 deletion src/hotspot/share/utilities/compilerWarnings_gcc.hpp
Expand Up @@ -39,9 +39,12 @@
#define PRAGMA_DIAG_PUSH _Pragma("GCC diagnostic push")
#define PRAGMA_DIAG_POP _Pragma("GCC diagnostic pop")

// 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
3 changes: 3 additions & 0 deletions src/hotspot/share/utilities/vmError.cpp
Expand Up @@ -190,6 +190,8 @@ static bool stack_has_headroom(size_t headroom) {
}

#ifdef ASSERT
PRAGMA_DIAG_PUSH
PRAGMA_INFINITE_RECURSION_IGNORED
void VMError::reattempt_test_hit_stack_limit(outputStream* st) {
if (stack_has_headroom(_reattempt_required_stack_headroom)) {
// Use all but (_reattempt_required_stack_headroom - K) unguarded stack space.
Expand Down Expand Up @@ -220,6 +222,7 @@ void VMError::reattempt_test_hit_stack_limit(outputStream* st) {
}
controlled_crash(14);
}
PRAGMA_DIAG_POP
#endif // ASSERT

bool VMError::can_reattempt_step(const char* &stop_reason) {
Expand Down

1 comment on commit bfc3ccd

@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.