From ebde3b8a5b9a62f3f9e18116adb58e68ad5966fd Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 12 Feb 2022 02:56:37 -0600 Subject: [PATCH] Move -Wno-string-plus-int to configure instead of probing for it. llvm still emits "C++ programmers do not understand C" warnings unless muzzled, but gcc versions that die when hitting -Wno-warning-you-do-not-produce seem to have cycled out. Oddly, gcc will still spuriously warn about unknown -Wno-thingy when generating OTHER warnings, which seems both useless and indecisive. (If you typo a -Wno-thingy so it doesn't suppress the warning, you presumably notice that the warning it just generated did not get suppressed. It wasn't worth telling you about before, so why tack on some noise to the other output?) --- configure | 2 +- scripts/genconfig.sh | 7 ------- scripts/make.sh | 1 - 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/configure b/configure index af8e1134..ec938271 100755 --- a/configure +++ b/configure @@ -13,7 +13,7 @@ fi # CFLAGS and OPTIMIZE are different so you can add extra CFLAGS without # disabling default optimizations -[ -z "$CFLAGS" ] && CFLAGS="-Wall -Wundef -Wno-char-subscripts -Werror=implicit-function-declaration -Wno-pointer-sign" +[ -z "$CFLAGS" ] && CFLAGS="-Wall -Wundef -Wno-char-subscripts -Werror=implicit-function-declaration -Wno-pointer-sign -Wno-string-plus-int" # Required for our expected ABI. we're 8-bit clean thus "char" must be unsigned. CFLAGS="$CFLAGS -funsigned-char" [ -z "$OPTIMIZE" ] && OPTIMIZE="-Os -ffunction-sections -fdata-sections -fno-asynchronous-unwind-tables -fno-strict-aliasing" diff --git a/scripts/genconfig.sh b/scripts/genconfig.sh index 5498be53..01b2eaaf 100755 --- a/scripts/genconfig.sh +++ b/scripts/genconfig.sh @@ -24,13 +24,6 @@ probesymbol() probeconfig() { - > generated/cflags - # llvm produces its own really stupid warnings about things that aren't wrong, - # and although you can turn the warning off, gcc reacts badly to command line - # arguments it doesn't understand. So probe. - [ -z "$(probecc -Wno-string-plus-int <<< \#warn warn 2>&1 | grep string-plus-int)" ] && - echo -Wno-string-plus-int >> generated/cflags - # Probe for container support on target probesymbol TOYBOX_CONTAINER << EOF #include diff --git a/scripts/make.sh b/scripts/make.sh index 3c6b4f1e..52da6a37 100755 --- a/scripts/make.sh +++ b/scripts/make.sh @@ -63,7 +63,6 @@ fi [ ! -z "$GITHASH" ] && GITHASH="-DTOYBOX_VERSION=\"$GITHASH\"" TOYFILES="$($SED -n 's/^CONFIG_\([^=]*\)=.*/\1/p' "$KCONFIG_CONFIG" | xargs | tr ' [A-Z]' '|[a-z]')" TOYFILES="main.c $(egrep -l "TOY[(]($TOYFILES)[ ,]" toys/*/*.c | xargs)" -CFLAGS="$CFLAGS $(cat generated/cflags)" BUILD="$(echo ${CROSS_COMPILE}${CC} $CFLAGS -I . $OPTIMIZE $GITHASH)" LIBFILES="$(ls lib/*.c)" -- 2.39.2