# HG changeset patch # User John W. Eaton # Date 1470698549 14400 # Node ID 60faa7c85e3186b9fbc750e0907f602a226a9d15 # Parent a8fd02bc895b4672f7d95133b6856a93b7495d37 don't use -Wshadow for GCC 4 * configure.ac: Omit -Wshadow from list of extra warning flags when using GCC 4. diff -r a8fd02bc895b -r 60faa7c85e31 configure.ac --- a/configure.ac Tue Aug 09 11:09:38 2016 -0700 +++ b/configure.ac Mon Aug 08 19:22:29 2016 -0400 @@ -2718,17 +2718,25 @@ fi AM_CONDITIONAL([AMCOND_BUILD_DOCS], [test $ENABLE_DOCS = yes]) +case "$GCC_VERSION" in + *4*) + ;; + *) + GCC_WSHADOW_OPTION=-Wshadow + ;; +esac + ### Maybe add -Wall, -W, and -Wshadow to compiler flags now that we're ### done feature testing. -GCC_EXTRA_FLAGS="-Wall -W -Wshadow -Wformat -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wcast-align -Wcast-qual" -GXX_EXTRA_FLAGS="-Wall -W -Wshadow -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual" +GCC_EXTRA_FLAGS="-Wall -W $GCC_WSHADOW_OPTION -Wformat -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wcast-align -Wcast-qual" +GXX_EXTRA_FLAGS="-Wall -W $GCC_WSHADOW_OPTION -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual" try_extra_warning_flags=yes AC_ARG_ENABLE([extra-warning-flags], [AS_HELP_STRING([--disable-extra-warning-flags], - [don't add -Wall, -W, -Wshadow, and -Wold-style-cast options to CFLAGS and CXXFLAGS])], + [don't add -Wall, -W, -Wformat, -Wold-style-cast, and other warning options to CFLAGS and CXXFLAGS])], [if test "$enableval" = no; then try_extra_warning_flags=no fi],