Re: Properly controlling CFLAGS/CXXFLAGS



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@xxxxxxxxxxx | http://www.escapebox.net
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Moving from 8051 to AVR
    ... Actually it is almost impossible to do with Gcc. ... switch to a host that can't execute IA32 ELF binaries, ... back when before IA32 went away as a host platform. ... everything in order to "switch" to an older compiler. ...
    (comp.arch.embedded)
  • Re: drivers/net/wireless/b43legacy/ on mips
    ... because some versions of gcc emit a __ucmpdi2 call for switch statements. ... 32-bit kernels gcc 3.2 is the minimum but 3.2 is broken beyond recovery ...
    (Linux-Kernel)
  • Re: [PATCH] 2.6 workaround for Athlon/Opteron prefetch errata
    ... >> the switchstatement already so I don't think it is worth it to go ... bytes in a switch. ... Or maybe gcc should do that, ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: drivers/net/wireless/b43legacy/ on mips
    ... because some versions of gcc emit a __ucmpdi2 call for switch statements. ... 32-bit kernels gcc 3.2 is the minimum but 3.2 is broken beyond recovery ...
    (Linux-Kernel)
  • Re: C Questions
    ... when we put -pedantic switch we are complying with c89 standards ... _both_ required for gcc to attempt to conform to C89. ... int main(int argc, char *argv) { ...
    (comp.lang.c)