[PATCH] configure.ac: Add -Wlogical-op, if its not noisy

Marcus Meissner marcus at jet.franken.de
Fri Dec 17 14:29:20 CST 2010


Hi,

Picking up Geralds idea of -Wlogical-op addition,
with a testcase if strchr() is noisy.

Ciao, Marcus
---
 configure.ac |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index 2b1b7aa..e60c11d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1681,6 +1681,17 @@ then
     EXTRACFLAGS="$EXTRACFLAGS -Wpointer-arith"
   fi
 
+  dnl Check for noisy string.h on logical ops
+  saved_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -Wlogical-op -Werror"
+  AC_CACHE_CHECK([for broken string.h that generates warnings on -Wlogical-op], ac_cv_c_logicalop_noisy,
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string.h>]], [[char*f(const char *h,char n) {return strchr(h,n);}]])],[ac_cv_c_logicalop_noisy=no],[ac_cv_c_logicalop_noisy=yes]))
+  CFLAGS="$saved_CFLAGS"
+  if test "$ac_cv_c_logicalop_noisy" = "no"
+  then
+    EXTRACFLAGS="$EXTRACFLAGS -Wlogical-op"
+  fi
+
   dnl Enable -Werror for maintainer mode
   if test "x$enable_maintainer_mode" = "xyes"
   then
-- 
1.7.1



More information about the wine-patches mailing list