On Wed, 29 Feb 2012 23:33:24 +0100 Cedric Blancher wrote: > On 29 February 2012 08:49, Michal Hlavinka <[email protected]> wrote: > > warning: dereferencing type-punned pointer will break strict-aliasing rules > > > > If some optimization can't be used, it should be turned off.
> This is not an issue with optimisation which is open for debate. This > issue is about strict aliasing rules which are part of the ANSI/ISO C > specification (older versions of the ANSI/ISO standard and K&R left > the issue open for interpretation but since ANSI/ISO C99 there are > clear and strict rules to end the chaos) and the violation of those > rules result in undefined behaviour. It may work with one compiler and > break with others. Likely more going to break with modern compilers > like icc, Sun Studio or gcc with O3/LTO enabled. if c99 were the only compiler available tomorrow I would agree however it seems strict-aliasing violations in the wild are common enough to have delayed the adoption of strict-aliasing as the default for many cc implementations so while adhering to that part of the standard is ultimately not up for debate *when* to adhere to it is especially when the aliasing warning messages seem to be too sensitive to cc point releases so could submitters include the cc version/point-release with warning message posts then when there is consensus on the actual no-strict-aliasing lines (I would feel better if two independent cc implementations picked the same lines) we will fix the code _______________________________________________ ast-developers mailing list [email protected] https://mailman.research.att.com/mailman/listinfo/ast-developers
