Fix -Wno-unknown-warning support detection
[deliverable/binutils-gdb.git] / gdb / configure
index 249a39975b027e6fad0f550282e8df2a3aa4ddb9..4c308cb2c6853d9aa5561d13af3fbd079b316cc5 100755 (executable)
@@ -14376,14 +14376,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.027076 seconds and 4 git commands to generate.