aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-10-31 11:57:50 -0400
committerNick Mathewson <nickm@torproject.org>2013-10-31 11:57:50 -0400
commit4c6081910d4c0f5848c6ebfba65798a0985111bb (patch)
treee452527e519a6ea0cdacbfc59b5b3e1ccbacf429 /configure.ac
parentd3420e7e73a3ca7b6fd359c03668833200a79372 (diff)
downloadtor-4c6081910d4c0f5848c6ebfba65798a0985111bb.tar
tor-4c6081910d4c0f5848c6ebfba65798a0985111bb.tar.gz
Only use -Wlogical-op with GCC 4.6 and later
It generates an apparently spurious warning with gcc 4.4 in debian; we haven't tested 4.5.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac16
1 files changed, 15 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 974ff2707..536a2b383 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1446,6 +1446,12 @@ if test x$enable_gcc_warnings = xyes || test x$enable_gcc_warnings_advisory = xy
#error
#endif])], have_gcc43=yes, have_gcc43=no)
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
+#if !defined(__GNUC__) || (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)
+#error
+#endif])], have_gcc46=yes, have_gcc46=no)
+
+
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wshorten-64-to-32"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], have_shorten64_flag=yes,
@@ -1494,13 +1500,21 @@ if test x$enable_gcc_warnings = xyes || test x$enable_gcc_warnings_advisory = xy
if test x$have_gcc43 = xyes ; then
# These warnings break gcc 4.2 and work on gcc 4.3
# XXXX020 See if any of these work with earlier versions.
- CFLAGS="$CFLAGS -Wextra -Warray-bounds -Wlogical-op"
+ CFLAGS="$CFLAGS -Wextra -Warray-bounds"
+ fi
+
+ if test x$have_gcc46 = xyes ; then
+ # This warning was added in gcc 4.3, but it appears to generate
+ # spurious warnings in gcc 4.4. I don't know if it works in 4.5.
+ CFLAGS="$CFLAGS -Wlogical-op"
fi
if test x$have_shorten64_flag = xyes ; then
CFLAGS="$CFLAGS -Wshorten-64-to-32"
fi
+
+
##This will break the world on some 64-bit architectures
# CFLAGS="$CFLAGS -Winline"
fi