aboutsummaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-02-21 20:54:45 +0000
committerNick Mathewson <nickm@torproject.org>2008-02-21 20:54:45 +0000
commite790dbe779de620bdb0b2f52d4d04ce84bb7c5a8 (patch)
treedc0756bf9d604c966a0c1b3d79a1d731a3730c6a /configure.in
parent5c03f82a650e3986c37466197d79d85906cce671 (diff)
downloadtor-e790dbe779de620bdb0b2f52d4d04ce84bb7c5a8.tar
tor-e790dbe779de620bdb0b2f52d4d04ce84bb7c5a8.tar.gz
r18347@catbus: nickm | 2008-02-21 15:54:40 -0500
Make autoconf autodetect -Wshorten-64-to-32 when --enable-gcc-warnings is given to the configure script. svn:r13661
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in13
1 files changed, 12 insertions, 1 deletions
diff --git a/configure.in b/configure.in
index 0445ad97f..cf32d04f5 100644
--- a/configure.in
+++ b/configure.in
@@ -711,6 +711,12 @@ if test x$enable_gcc_warnings = xyes; then
#error
#endif]), have_gcc42=yes, have_gcc42=no)
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Wshorten-64-to-32"
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([], []), have_shorten64_flag=yes,
+ have_shorten64_flag=no)
+ CFLAGS="$save_CFLAGS"
+
CFLAGS="$CFLAGS -W -Wfloat-equal -Wundef -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wbad-function-cast -Wswitch-enum -Werror"
# Disabled, so we can use mallinfo(): -Waggregate-return
@@ -726,11 +732,16 @@ if test x$enable_gcc_warnings = xyes; then
CFLAGS="$CFLAGS -Waddress -Wmissing-noreturn -Wnormalized=id -Woverride-init -Wstrict-overflow=5"
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
+
+
CPPFLAGS="$CPPFLAGS $TOR_CPPFLAGS_libevent $TOR_CPPFLAGS_openssl $TOR_CPPFLAGS_zlib"
AC_CONFIG_FILES([Makefile tor.spec Doxyfile contrib/tor.sh contrib/torctl contrib/torify contrib/tor.logrotate contrib/Makefile contrib/osx/Makefile contrib/osx/TorBundleDesc.plist contrib/osx/TorBundleInfo.plist contrib/osx/TorDesc.plist contrib/osx/TorInfo.plist contrib/osx/TorStartupDesc.plist src/config/torrc.sample doc/tor.1 src/Makefile doc/Makefile doc/design-paper/Makefile doc/spec/Makefile src/config/Makefile src/common/Makefile src/or/Makefile src/win32/Makefile src/tools/Makefile contrib/suse/Makefile contrib/suse/tor.sh])