From a17fee77885125974adf3499f23d6de8835d0f38 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Fri, 29 Dec 2023 16:46:41 -0600 Subject: [PATCH] Silence more false positive gcc warnings. ASAN finds leaks. The gcc array overlap detector isn't even close to sane, and we have to switch it off TWICE for some reason. --- scripts/portability.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/portability.sh b/scripts/portability.sh index 4241916a..e8ad197a 100644 --- a/scripts/portability.sh +++ b/scripts/portability.sh @@ -22,9 +22,11 @@ else : ${LDOPTIMIZE:=-Wl,--gc-sections -Wl,--as-needed} ${STRIP:=strip -s -R .note* -R .comment} fi -# Disable a pointless warning only clang produces +# Disable pointless warnings only clang produces [ -n "$("$CROSS_COMPILE$CC" --version | grep -w clang)" ] && - CFLAGS+=" -Wno-string-plus-int -Wno-invalid-source-encoding" + CFLAGS+=" -Wno-string-plus-int -Wno-invalid-source-encoding" || +# And ones only gcc produces + CFLAGS+=" -Wno-restrict -Wno-format-overflow" # Address Sanitizer if [ -n "$ASAN" ]; then -- 2.39.2