Properly controlling CFLAGS/CXXFLAGS
Uwe Doering
gemini at geminix.org
Fri Dec 22 17:19:43 PST 2006
Garrett Cooper wrote:
>> [...]
> Interesting. No wonder I didn't have it in my Gentoo /etc/make.conf. It
> appears (from what I see) that maybe -fno-strict-aliasing has been
> enabled by default (at least it doesn't show up in the GCC 4.1.1 manpage
> on FC5).
It's documented in GCC's info page. There, you may want to search for
'-fstrict-aliasing' instead of '-fno-strict-aliasing'. The 'no-' prefix
is generic and can be used to switch off flags that are on by default or
have been set to on earlier in the command line.
With '-O2' and better, '-fstrict-aliasing' is the default in newer
versions of GCC, AFAIK, but people tend to switch it off because it
apparently breaks too many software packages. Or at least those whose
code base dates back to times where '-fno-strict-aliasing' was the
default and people got away with certain nasty coding hacks that no
longer work with '-fstrict-aliasing'.
Uwe
--
Uwe Doering | EscapeBox - Managed On-Demand UNIX Servers
gemini at geminix.org | http://www.escapebox.net
More information about the freebsd-hackers
mailing list