From ee162a0b2144877048f6d08dd9168fd75e000fa6 Mon Sep 17 00:00:00 2001 From: Mateusz Daniluk <121170681+VeithMetro@users.noreply.github.com> Date: Tue, 12 Nov 2024 13:06:52 +0100 Subject: [PATCH] The stringop-overread warning is not available on clang --- Source/core/Portability.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/core/Portability.h b/Source/core/Portability.h index bea130a23..65a3fd146 100644 --- a/Source/core/Portability.h +++ b/Source/core/Portability.h @@ -218,7 +218,6 @@ #define DISABLE_WARNING_DEPRECATED_COPY PUSH_WARNING_ARG_("-Wdeprecated-copy") #define DISABLE_WARNING_NON_VIRTUAL_DESTRUCTOR PUSH_WARNING_ARG_("-Wnon-virtual-dtor") #define DISABLE_WARNING_TYPE_LIMITS PUSH_WARNING_ARG_("-Wtype-limits") -#define DISABLE_WARNING_STRING_OPERATION_OVERREAD PUSH_WARNING_ARG_("-Wstringop-overread") #define DISABLE_WARNING_PEDANTIC PUSH_WARNING_ARG_("-Wpedantic") #define DISABLE_WARNING_OVERLOADED_VIRTUALS PUSH_WARNING_ARG_("-Woverloaded-virtual") #define DISABLE_WARNING_CONVERSION_TO_GREATERSIZE PUSH_WARNING_ARG_("-Wint-to-pointer-cast") @@ -229,6 +228,13 @@ #define DISABLE_WARNING_FREE_NONHEAP_OBJECT PUSH_WARNING_ARG_("-Wfree-nonheap-object") #define DISABLE_WARNING_ARRAY_BOUNDS PUSH_WARNING_ARG_("-Warray-bounds") #endif + +#if !(defined(__clang__)) && (__GNUC__ >= 4) +#define DISABLE_WARNING_STRING_OPERATION_OVERREAD PUSH_WARNING_ARG_("-Wstringop-overread") +#else +#define DISABLE_WARNING_STRING_OPERATION_OVERREAD +#endif + #endif #if defined WIN32 || defined _WINDOWS