From: "Daniel P. Berrange" <berra...@redhat.com>

Some warning flags have dependancies, eg -Wformat-security cannot
be enabled if -Wformat is not already enabled. The compiler
flag checking code was checking each flag in isolation so several
were not getting enabled. The fix is to supply all previously
confirmed flags when checking a flag

Signed-off-by: Daniel P. Berrange <berra...@redhat.com>
---
 configure |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index cd40d17..64ab4dc 100755
--- a/configure
+++ b/configure
@@ -1168,11 +1168,13 @@ gcc_flags="$gcc_flags -Wendif-labels"
 cat > $TMPC << EOF
 int main(void) { return 0; }
 EOF
+warning_flags=
 for flag in $gcc_flags; do
-    if compile_prog "-Werror $flag" "" ; then
-       QEMU_CFLAGS="$QEMU_CFLAGS $flag"
+    if compile_prog "-Werror $warning_flags $flag" "" ; then
+       warning_flags="$warning_flags $flag"
     fi
 done
+QEMU_CFLAGS="$QEMU_CFLAGS $warning_flags"
 
 if test "$static" = "yes" ; then
   if test "$pie" = "yes" ; then
-- 
1.7.7.6


Reply via email to