Make -Wformat-nonliteral work with gcc
[deliverable/binutils-gdb.git] / gdb / gdbserver / configure
index 7454cd8ad37a97a12e870af9525dcfe86edd92b2..f5cbbaea78a15f2e32d5f782fbc1c6c3127c3de5 100755 (executable)
@@ -7258,7 +7258,10 @@ case "${host}" in
     build_warnings="$build_warnings -Wno-unknown-pragmas"
     # Solaris 11 <unistd.h> marks vfork deprecated.
     build_warnings="$build_warnings -Wno-deprecated-declarations" ;;
-  *) build_warnings="$build_warnings -Wformat-nonliteral" ;;
+  *)
+    # Note that gcc requires -Wformat for -Wformat-nonliteral to work,
+    # but there's a special case for this below.
+    build_warnings="$build_warnings -Wformat-nonliteral" ;;
 esac
 
 # Check whether --enable-build-warnings was given.
@@ -7314,6 +7317,12 @@ $as_echo_n "checking compiler warning flags... " >&6; }
        case $w in
        -Wno-*)
                wtest=`echo $w | sed 's/-Wno-/-W/g'` ;;
+        -Wformat-nonliteral)
+               # gcc requires -Wformat before -Wformat-nonliteral
+               # will work, so stick them together.
+               w="-Wformat $w"
+               wtest="$w"
+               ;;
        *)
                wtest=$w ;;
        esac
This page took 0.02479 seconds and 4 git commands to generate.