[or-cvs] r13661: Make autoconf autodetect -Wshorten-64-to-32 when --enable-gc (tor/trunk)

nickm at seul.org nickm at seul.org
Thu Feb 21 20:54:45 UTC 2008


Author: nickm
Date: 2008-02-21 15:54:45 -0500 (Thu, 21 Feb 2008)
New Revision: 13661

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/configure.in
Log:
 r18347 at 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.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r18347] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2008-02-21 18:45:11 UTC (rev 13660)
+++ tor/trunk/ChangeLog	2008-02-21 20:54:45 UTC (rev 13661)
@@ -46,6 +46,10 @@
     - When SafeLogging is disabled, log addresses along with all TLS
       errors.
 
+  o Minor features (build):
+    - When built with --enable-gcc-warnings, check for whether Apple's
+      warning "-Wshorten-64-to-32" is enabled.
+
   o Minor bugfixes:
     - Log the correct memory chunk sizes for empty RAM chunks in mempool.c.
     - Directory mirrors no longer include a guess at the client's IP

Modified: tor/trunk/configure.in
===================================================================
--- tor/trunk/configure.in	2008-02-21 18:45:11 UTC (rev 13660)
+++ tor/trunk/configure.in	2008-02-21 20:54:45 UTC (rev 13661)
@@ -711,6 +711,12 @@
 #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 @@
     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])



More information about the tor-commits mailing list