8301244: Tidy up compiler specific warnings files

Reviewed-by: kbarrett, dholmes
This commit is contained in:
Julian Waters 2023-03-14 07:24:18 +00:00
parent c073ef2ed5
commit 2bb990edde
2 changed files with 5 additions and 8 deletions

@ -34,9 +34,7 @@
#define ATTRIBUTE_SCANF(fmt,vargs) __attribute__((format(scanf, fmt, vargs)))
#endif
#define PRAGMA_DISABLE_GCC_WARNING_AUX(x) _Pragma(#x)
#define PRAGMA_DISABLE_GCC_WARNING(option_string) \
PRAGMA_DISABLE_GCC_WARNING_AUX(GCC diagnostic ignored option_string)
#define PRAGMA_DISABLE_GCC_WARNING(optstring) _Pragma(STR(GCC diagnostic ignored optstring))
#define PRAGMA_FORMAT_NONLITERAL_IGNORED \
PRAGMA_DISABLE_GCC_WARNING("-Wformat-nonliteral") \
@ -56,8 +54,7 @@
#define PRAGMA_STRINGOP_OVERFLOW_IGNORED PRAGMA_DISABLE_GCC_WARNING("-Wstringop-overflow")
#endif
#define PRAGMA_NONNULL_IGNORED \
PRAGMA_DISABLE_GCC_WARNING("-Wnonnull")
#define PRAGMA_NONNULL_IGNORED PRAGMA_DISABLE_GCC_WARNING("-Wnonnull")
#if defined(__clang_major__) && \
(__clang_major__ >= 4 || \

@ -25,10 +25,10 @@
#ifndef SHARE_UTILITIES_COMPILERWARNINGS_VISCPP_HPP
#define SHARE_UTILITIES_COMPILERWARNINGS_VISCPP_HPP
#define PRAGMA_DIAG_PUSH __pragma(warning(push))
#define PRAGMA_DIAG_POP __pragma(warning(pop))
#define PRAGMA_DISABLE_MSVC_WARNING(num) _Pragma(STR(warning(disable : num)))
#define PRAGMA_DISABLE_MSVC_WARNING(num) __pragma(warning(disable : num))
#define PRAGMA_DIAG_PUSH _Pragma("warning(push)")
#define PRAGMA_DIAG_POP _Pragma("warning(pop)")
// The Visual Studio implementation of FORBID_C_FUNCTION explicitly does
// nothing, because there doesn't seem to be a way to implement it for Visual