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

[libvirt] [PATCH] build: Check for broken GCC -Wlogical-op was too optimistic



The check for a broken GCC -Wlogical-op implemententation
was written under the wrong assumption that unknown warning
options would be gracefully ignored.
Thanks to Eric Blake and Daniel Berrange for pointing that
out.

Signed-off-by: Viktor Mihajlovski <mihajlov linux vnet ibm com>
---
 configure.ac |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 20caa92..828ae01 100644
--- a/configure.ac
+++ b/configure.ac
@@ -260,7 +260,13 @@ dnl which is the case with a certain range of GCC versions
 AC_MSG_CHECKING([whether GCC -Wlogical-op is broken])
 
 save_CFLAGS="$CFLAGS"
-CFLAGS="-O2 -Wlogical-op -Werror"
+for w_opt in $WARN_CFLAGS; do
+   case $w_opt in
+      "-Wlogical-op" | "-Werror" )
+         CFLAGS="$CFLAGS $w_opt"
+      ;;
+   esac
+done
 
 AC_TRY_COMPILE([#include <string.h>],
                 [const char *haystack;
-- 
1.7.9.5


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