8288048: Build failure with GCC 6 after JDK-8286562

Reviewed-by: kbarrett, ysuenaga
This commit is contained in:
Aleksey Shipilev 2022-06-09 14:16:07 +00:00
parent db4405d0f8
commit 59b0de6bc7
3 changed files with 11 additions and 1 deletions

View File

@ -138,7 +138,7 @@ inline void JfrTraceIdBits::store(jbyte bits, const T* ptr) {
// goes away with minor code perturbations, such as replacing function calls
// with equivalent code directly inlined.
PRAGMA_DIAG_PUSH
PRAGMA_DISABLE_GCC_WARNING("-Wstringop-overflow")
PRAGMA_STRINGOP_OVERFLOW_IGNORED
set(bits, traceid_tag_byte(ptr));
PRAGMA_DIAG_POP
}

View File

@ -66,6 +66,10 @@
#define PRAGMA_STRINGOP_TRUNCATION_IGNORED
#endif
#ifndef PRAGMA_STRINGOP_OVERFLOW_IGNORED
#define PRAGMA_STRINGOP_OVERFLOW_IGNORED
#endif
#ifndef PRAGMA_NONNULL_IGNORED
#define PRAGMA_NONNULL_IGNORED
#endif

View File

@ -50,6 +50,12 @@
#define PRAGMA_STRINGOP_TRUNCATION_IGNORED PRAGMA_DISABLE_GCC_WARNING("-Wstringop-truncation")
#endif
// Disable -Wstringop-overflow which is introduced in GCC 7.
// https://gcc.gnu.org/gcc-7/changes.html
#if !defined(__clang_major__) && (__GNUC__ >= 7)
#define PRAGMA_STRINGOP_OVERFLOW_IGNORED PRAGMA_DISABLE_GCC_WARNING("-Wstringop-overflow")
#endif
#define PRAGMA_NONNULL_IGNORED \
PRAGMA_DISABLE_GCC_WARNING("-Wnonnull")