diff --git a/configure b/configure index 4f35f1553..bd7aae297 100755 --- a/configure +++ b/configure @@ -62,6 +62,9 @@ default_cwarnflags() if [ -n "${1##*-O3*}" ] || [ "$3" != "1" ]; then F="$F -Wno-maybe-uninitialized" fi + # Recent clang understands that, but at least our MacOS CI doesn't, so keep + # this gcc-only. + F="$F -Wshadow=local" fi echo "$F" } @@ -223,6 +226,11 @@ for opt in "$@"; do if [ x"$COPTFLAGS" = x"$DEFAULT_COPTFLAGS" ]; then unset COPTFLAGS fi + # If they didn't have -Wshadow=local, add it on --reconfigure + # (we only added it later) + if [ x"${CWARNFLAGS%*-Wshadow=local}" = x"$CWARNFLAGS" ]; then + unset CWARNFLAGS + fi ;; CC=*) CC="${opt#CC=}";; CONFIGURATOR_CC=*) CONFIGURATOR_CC="${opt#CONFIGURATOR_CC=}";;