diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-01-31 07:51:02 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-01-31 07:51:02 +0000 |
commit | 676cfbbf8404c62c420223f5aee4bd8c5e69cee0 (patch) | |
tree | 0b8341a397909bdf8a94f050765bc0073d4d0691 /configure.in | |
parent | ec9c0597578f543e328646cfb9a664d9bc0748e2 (diff) | |
download | tor-676cfbbf8404c62c420223f5aee4bd8c5e69cee0.tar.gz tor-676cfbbf8404c62c420223f5aee4bd8c5e69cee0.zip |
When building with GCC, use -fno-strict-aliasing
GCC's interpretation of the C99 aliasing rules, to be charitable,
creates a dialect of C intended for a better programmers than I am
certain of my ability to be in all times. I just spent 2 hours
tracking down a platform-hyperspecific libevent bug that turned out to
be because of this, and darned if I ever want to do *that* again.
One of Linus's recent rants will give you a picture of why GCC's
behavior here can lead to fun surprises in your binaries:
http://lwn.net/Articles/316126/
svn:r18351
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/configure.in b/configure.in index 52c40cb7c0..c661b377bb 100644 --- a/configure.in +++ b/configure.in @@ -754,8 +754,11 @@ AC_SUBST(LOCALSTATEDIR) # Set CFLAGS _after_ all the above checks, since our warnings are stricter # than autoconf's macros like. -if test "$ac_cv_c_compiler_gnu" = yes; then +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" else CFLAGS="$CFLAGS -g -O" enable_gcc_warnings=no |