[tor-commits] [tor/maint-0.2.2] Remove superfluous -g -O2 compiler argument

nickm at torproject.org nickm at torproject.org
Fri Mar 18 16:41:47 UTC 2011


commit 3f94c4a1cb284ad177bbf2171d6d1c955d8baa85
Author: Sebastian Hahn <sebastian at torproject.org>
Date:   Fri Mar 18 17:04:01 2011 +0100

    Remove superfluous -g -O2 compiler argument
    
    Autoconf adds -g -O2 by default, so adding it ourselves is not required.
    It also caused a warning with clang for every source file, so remove it
    here. Fixes last issue of ticket 2696.
---
 configure.in |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/configure.in b/configure.in
index 9999f60..4436fe2 100644
--- a/configure.in
+++ b/configure.in
@@ -865,12 +865,13 @@ fi
 # Set CFLAGS _after_ all the above checks, since our warnings are stricter
 # than autoconf's macros like.
 if test "$GCC" = yes; then
-  CFLAGS="$CFLAGS -Wall -g -O2"
   # Disable GCC's strict aliasing checks.  They are an hours-to-debug
   # accident waiting to happen.
-  CFLAGS="$CFLAGS -fno-strict-aliasing"
+  CFLAGS="$CFLAGS -Wall -fno-strict-aliasing"
 else
-  CFLAGS="$CFLAGS -g -O"
+  # Autoconf sets -g -O2 by default. Override optimization level
+  # for non-gcc compilers
+  CFLAGS="$CFLAGS -O"
   enable_gcc_warnings=no
   enable_gcc_warnings_advisory=no
 fi





More information about the tor-commits mailing list