From f492273712d780f4d90966952362743b85f4c8cf Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 14 Sep 2022 02:43:39 -0500 Subject: [PATCH] Move -Wno-string-plus-int to portability.sh and have it only apply to clang. On gcc that spurious warning isn't generated so the -W to suppress it isn't recognized. It doesn't complain an unknown -Wno-blah unless it's producing other warnings, but when it does there's always an extra line of noise, so fix it. --- configure | 2 +- scripts/portability.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 05565a83..d6bbd7da 100755 --- a/configure +++ b/configure @@ -13,7 +13,7 @@ fi # Warn about stuff, disable stupid warnings, be 8-bit clean for utf8. [ "${CFLAGS/-funsigned-char//}" == "$CFLAGS" ] && - CFLAGS+=" -Wall -Wundef -Werror=implicit-function-declaration -Wno-char-subscripts -Wno-pointer-sign -Wno-string-plus-int -funsigned-char" + CFLAGS+=" -Wall -Wundef -Werror=implicit-function-declaration -Wno-char-subscripts -Wno-pointer-sign -funsigned-char" # Set default values if variable not already set : ${CC:=cc} ${HOSTCC:=cc} ${GENDIR:=generated} ${KCONFIG_CONFIG:=.config} diff --git a/scripts/portability.sh b/scripts/portability.sh index dafde260..60c1d4b9 100644 --- a/scripts/portability.sh +++ b/scripts/portability.sh @@ -22,6 +22,10 @@ else : ${LDOPTIMIZE:=-Wl,--gc-sections -Wl,--as-needed} ${STRIP:=strip -s -R .note* -R .comment} fi +# Disable a pointless warning only clang produces +[ -n "$("$CROSS_COMPILE"cc --version | grep -w clang)" ] && + CFLAGS+=" -Wno-string-plus-int" + # Address Sanitizer if [ ! -z "$ASAN" ]; then # Turn ASan on and disable most optimization to get more readable backtraces.