Marcus Meissner : configure.ac: Add -Wlogical-op, if it's not noisy.
Alexandre Julliard
julliard at winehq.org
Mon Dec 20 17:49:48 CST 2010
Module: wine
Branch: master
Commit: f825f0d04a507734ed054fae38975c57043fa97f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f825f0d04a507734ed054fae38975c57043fa97f
Author: Marcus Meissner <marcus at jet.franken.de>
Date: Fri Dec 17 21:29:20 2010 +0100
configure.ac: Add -Wlogical-op, if it's not noisy.
---
configure | 37 +++++++++++++++++++++++++++++++++++--
configure.ac | 13 ++++++++++++-
2 files changed, 47 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index d44e6a6..a83e6b7 100755
--- a/configure
+++ b/configure
@@ -12229,8 +12229,8 @@ fi
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wpointer-arith -Werror"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken string.h that generates warnings" >&5
-$as_echo_n "checking for broken string.h that generates warnings... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken string.h that generates warnings with -Wpointer-arith" >&5
+$as_echo_n "checking for broken string.h that generates warnings with -Wpointer-arith... " >&6; }
if test "${ac_cv_c_string_h_warnings+set}" = set; then :
$as_echo_n "(cached) " >&6
else
@@ -12260,6 +12260,39 @@ $as_echo "$ac_cv_c_string_h_warnings" >&6; }
EXTRACFLAGS="$EXTRACFLAGS -Wpointer-arith"
fi
+ saved_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Wlogical-op -Werror"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken string.h that generates warnings with -Wlogical-op" >&5
+$as_echo_n "checking for broken string.h that generates warnings with -Wlogical-op... " >&6; }
+if test "${ac_cv_c_logicalop_noisy+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+int
+main ()
+{
+char*f(const char *h,char n) {return strchr(h,n);}
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_logicalop_noisy=no
+else
+ ac_cv_c_logicalop_noisy=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_logicalop_noisy" >&5
+$as_echo "$ac_cv_c_logicalop_noisy" >&6; }
+ CFLAGS="$saved_CFLAGS"
+ if test "$ac_cv_c_logicalop_noisy" = "no"
+ then
+ EXTRACFLAGS="$EXTRACFLAGS -Wlogical-op"
+ fi
+
if test "x$enable_maintainer_mode" = "xyes"
then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Werror" >&5
diff --git a/configure.ac b/configure.ac
index 43769e7..0706192 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1673,7 +1673,7 @@ then
dnl Check for noisy string.h
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wpointer-arith -Werror"
- AC_CACHE_CHECK([for broken string.h that generates warnings], ac_cv_c_string_h_warnings,
+ AC_CACHE_CHECK([for broken string.h that generates warnings with -Wpointer-arith], ac_cv_c_string_h_warnings,
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string.h>]], [[]])],[ac_cv_c_string_h_warnings=no],[ac_cv_c_string_h_warnings=yes]))
CFLAGS="$saved_CFLAGS"
if test "$ac_cv_c_string_h_warnings" = "no"
@@ -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 with -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
More information about the wine-cvs
mailing list