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.
This commit is contained in:
Rob Landley 2022-09-14 02:43:39 -05:00
parent 630394b869
commit f492273712
2 changed files with 5 additions and 1 deletions

2
configure vendored
View File

@ -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}

View File

@ -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.