Fix -Wno-unknown-warning support detection
[deliverable/binutils-gdb.git] / gdb / gdbserver / configure
index ccb9639d5208460b5b68c2528805634835446c7f..ab03cacfe9f630bf192edb881d07bcd2cd138e9e 100755 (executable)
@@ -6148,14 +6148,23 @@ $as_echo_n "checking compiler warning flags... " >&6; }
     # Separate out the -Werror flag as some files just cannot be
     # compiled with it enabled.
     for w in ${build_warnings}; do
+       # GCC does not complain about -Wno-unknown-warning.  Invert
+       # and test -Wunknown-warning instead.
+       case $w in
+       -Wno-*)
+               wtest=`echo $w | sed 's/-Wno-/-W/g'` ;;
+       *)
+               wtest=$w ;;
+       esac
+
        case $w in
        -Werr*) WERROR_CFLAGS=-Werror ;;
        *)
            # Check whether GCC accepts it.
            saved_CFLAGS="$CFLAGS"
-           CFLAGS="$CFLAGS $w"
+           CFLAGS="$CFLAGS $wtest"
            saved_CXXFLAGS="$CXXFLAGS"
-           CXXFLAGS="$CXXFLAGS $w"
+           CXXFLAGS="$CXXFLAGS $wtest"
            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
This page took 0.025643 seconds and 4 git commands to generate.