Skip to content

Commit bfc3ccd

Browse files
bobpengxieDamonFool
bobpengxie
authored andcommitted
8308283: Build failure with GCC12 & GCC13
Reviewed-by: erikj, jiefu
1 parent 57b8ed1 commit bfc3ccd

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

make/modules/java.desktop/lib/Awt2dLibraries.gmk

+1-1
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ else
456456
unused-result array-bounds
457457
# noexcept-type required for GCC 7 builds. Not required for GCC 8+.
458458
# expansion-to-defined required for GCC 9 builds. Not required for GCC 10+.
459-
HARFBUZZ_DISABLED_WARNINGS_CXX_gcc := class-memaccess noexcept-type expansion-to-defined
459+
HARFBUZZ_DISABLED_WARNINGS_CXX_gcc := class-memaccess noexcept-type expansion-to-defined dangling-reference
460460
HARFBUZZ_DISABLED_WARNINGS_clang := missing-field-initializers range-loop-analysis
461461
HARFBUZZ_DISABLED_WARNINGS_microsoft := 4267 4244
462462

src/hotspot/share/utilities/compilerWarnings.hpp

+4
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@
7474
#define PRAGMA_STRINGOP_OVERFLOW_IGNORED
7575
#endif
7676

77+
#ifndef PRAGMA_INFINITE_RECURSION_IGNORED
78+
#define PRAGMA_INFINITE_RECURSION_IGNORED
79+
#endif
80+
7781
#ifndef PRAGMA_NONNULL_IGNORED
7882
#define PRAGMA_NONNULL_IGNORED
7983
#endif

src/hotspot/share/utilities/compilerWarnings_gcc.hpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,12 @@
3939
#define PRAGMA_DIAG_PUSH _Pragma("GCC diagnostic push")
4040
#define PRAGMA_DIAG_POP _Pragma("GCC diagnostic pop")
4141

42-
// Disable -Wdangling-pointer which is introduced in GCC 12.
4342
#if !defined(__clang_major__) && (__GNUC__ >= 12)
43+
// Disable -Wdangling-pointer which is introduced in GCC 12.
4444
#define PRAGMA_DANGLING_POINTER_IGNORED PRAGMA_DISABLE_GCC_WARNING("-Wdangling-pointer")
45+
46+
// Disable -Winfinite-recursion which is introduced in GCC 12.
47+
#define PRAGMA_INFINITE_RECURSION_IGNORED PRAGMA_DISABLE_GCC_WARNING("-Winfinite-recursion")
4548
#endif
4649

4750
#define PRAGMA_FORMAT_NONLITERAL_IGNORED \

src/hotspot/share/utilities/vmError.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ static bool stack_has_headroom(size_t headroom) {
190190
}
191191

192192
#ifdef ASSERT
193+
PRAGMA_DIAG_PUSH
194+
PRAGMA_INFINITE_RECURSION_IGNORED
193195
void VMError::reattempt_test_hit_stack_limit(outputStream* st) {
194196
if (stack_has_headroom(_reattempt_required_stack_headroom)) {
195197
// Use all but (_reattempt_required_stack_headroom - K) unguarded stack space.
@@ -220,6 +222,7 @@ void VMError::reattempt_test_hit_stack_limit(outputStream* st) {
220222
}
221223
controlled_crash(14);
222224
}
225+
PRAGMA_DIAG_POP
223226
#endif // ASSERT
224227

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

0 commit comments

Comments
 (0)