Browse Source

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.
Rob Landley 1 year ago
parent
commit
f492273712
2 changed files with 5 additions and 1 deletions
  1. 1 1
      configure
  2. 4 0
      scripts/portability.sh

+ 1 - 1
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}

+ 4 - 0
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.