mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-15 11:59:16 +01:00
configure: add -Wshadow=local flag.
This will warn us if there are local variables which shadow the same-named variable. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
44d9e8d9c5
commit
2c72229106
1 changed files with 8 additions and 0 deletions
8
configure
vendored
8
configure
vendored
|
@ -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=}";;
|
||||
|
|
Loading…
Add table
Reference in a new issue