[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

On 12/19/2012 07:17 AM, Viktor Mihajlovski wrote:
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
NACK. This still doesn't do what I asked about moving the check into m4/virt-compile-warnings.m4. Alternate version coming up soon. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Viktor Mihajlovski