OSDN Git Service

configure: use -Wwombat to test whether gcc recognizes -Wno-wombat
authorPeter Maydell <peter.maydell@linaro.org>
Sat, 27 Oct 2012 21:19:07 +0000 (22:19 +0100)
committerBlue Swirl <blauwirbel@gmail.com>
Tue, 30 Oct 2012 18:52:57 +0000 (18:52 +0000)
gcc will silently accept unrecognized -Wno-wombat warning suppression
options (it only mentions them if it has to print a compiler warning
for some other reason). Since we already run a check for whether gcc
recognizes the warning options we use, we can easily make this use
the positive sense of the option when checking for support for the
suppression option. This doesn't have any effect except that it avoids
gcc emitting extra messages about unrecognized command line options
when it is printing other warning messages.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Igor Mitsyanko <i.mitsyanko@samsung.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
configure

index 3685020..9c6ac87 100755 (executable)
--- a/configure
+++ b/configure
@@ -1169,7 +1169,11 @@ cat > $TMPC << EOF
 int main(void) { return 0; }
 EOF
 for flag in $gcc_flags; do
-    if compile_prog "-Werror $flag" "" ; then
+    # Use the positive sense of the flag when testing for -Wno-wombat
+    # support (gcc will happily accept the -Wno- form of unknown
+    # warning options).
+    optflag="$(echo $flag | sed -e 's/^-Wno-/-W/')"
+    if compile_prog "-Werror $optflag" "" ; then
        QEMU_CFLAGS="$QEMU_CFLAGS $flag"
     fi
 done