qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] configure: use -Wwombat to test whether gcc rec


From: Stefan Weil
Subject: Re: [Qemu-devel] [PATCH] configure: use -Wwombat to test whether gcc recognizes -Wno-wombat
Date: Sat, 27 Oct 2012 23:32:39 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20120922 Iceowl/1.0b1 Icedove/3.0.11

Am 27.10.2012 23:19, schrieb Peter Maydell:
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<address@hidden>
---
  configure | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 37f712d..4c2ba06 100755
--- 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

Yes, that's really a very simple and working solution.

Reviewed-by: Stefan Weil <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]