summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-05-15 21:17:48 +0000
committerNick Mathewson <nickm@torproject.org>2007-05-15 21:17:48 +0000
commite043b86f47185e0d9df53dab12d42e46c8c35b83 (patch)
tree0ebfb1bbce0fbcfa7d6e470b98d5bf90e9889a02 /configure.in
parentbfdc366037690c74d1e6b73fc33e2f73842ed793 (diff)
downloadtor-e043b86f47185e0d9df53dab12d42e46c8c35b83.tar.gz
tor-e043b86f47185e0d9df53dab12d42e46c8c35b83.zip
r12764@catbus: nickm | 2007-05-15 17:17:39 -0400
Enable (and cope with) more GCC 4.2 warnings. svn:r10196
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in13
1 files changed, 13 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 7395436ab9..67560498af 100644
--- a/configure.in
+++ b/configure.in
@@ -615,6 +615,11 @@ if test x$enable_gcc_warnings = xyes; then
#error
#endif]), have_gcc4=yes, have_gcc4=no)
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([], [
+#if !defined(__GNUC__) || (__GNUC_MINOR__ < 2)
+#error
+#endif]), have_gcc42=yes, have_gcc42=no)
+
CFLAGS="$CFLAGS -W -Wfloat-equal -Wundef -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Waggregate-return -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wbad-function-cast -Wswitch-enum -Werror"
if test x$have_gcc4 = xyes ; then
@@ -622,6 +627,14 @@ if test x$enable_gcc_warnings = xyes; then
CFLAGS="$CFLAGS -Winit-self -Wmissing-field-initializers -Wdeclaration-after-statement -Wold-style-definition"
fi
+ if test x$have_gcc42 = xyes ; then
+ # These warnings break gcc 4.0.2 and work on gcc 4.2
+ # XXXX020 Use -fstack-protector.
+ # XXXX020 See if any of these work with earlier versions.
+ # XXXX020 See if we can get -Wstrict-overflow=x for x>1 working.
+ CFLAGS="$CFLAGS -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -W"
+ fi
+
##This will break the world on some 64-bit architectures
# CFLAGS="$CFLAGS -Winline"