Bruce, ISO C99 edition, section 6.5, paragraph 7 specifies that it is illegal (with exceptions) for pointers of different types to reference the same memory location. This helps the compiler to produce better and faster running code. If you turn strict aliasing off with -fno-strict-aliasing you will suffer a performance penalty with modern compilers, assuming your compiler still has such an option to disable strict aliasing. IMO the lack of strict aliasing is now, where C99 has become commonplace and C1X has been released, a major portability hazard which needs to be fixed.
Olga 2012/2/29 Bruce Lilly <[email protected]>: > On Tue, 28 Feb 2012 23:59:30 +0100 > ольга крыжановская <[email protected]> wrote: > >> Bruce, you have to pass CCFLAGS='-O3 -fstrict-aliasing >> -Wstrict-aliasing' to package make to see the aliasing warnings, >> -Wstrict-aliasing is not enabled by default. > > Why would you do so when compiling C (not C++)? > > "type-punned" has no defined meaning in any version of K&R's definitive > C Programming Language books, nor in any version of ANSI/ISO C standard > that I've seen. "punned" is the past tense of the word "pun", which is > inapplicable to C programming. It appears to be part of the bizarre > lingo associated with "C ploose ploose" jargon. -- , _ _ , { \/`o;====- Olga Kryzhanovska -====;o`\/ } .----'-/`-/ [email protected] \-`\-'----. `'-..-| / http://twitter.com/fleyta \ |-..-'` /\/\ Solaris/BSD//C/C++ programmer /\/\ `--` `--` _______________________________________________ ast-developers mailing list [email protected] https://mailman.research.att.com/mailman/listinfo/ast-developers
