[PATCH util-macros 1/2] Don't disable strict aliasing (-fno-strict-aliasing) globally

Gaetan Nadon memsize at videotron.ca
Mon Nov 1 05:48:21 PDT 2010


On Mon, 2010-11-01 at 11:32 +0100, Mark Kettenis wrote:

> I may be somewhat overcautious, but I would keep -fno-strict-aliasing
> as a default.  And I'd only enable -fstrict-aliasing for particular
> bits of code where it has a significant performance benefit, and
> people have done a careful analysis of the code to see if it is free
> of aliasing issues.


The cautious approach is the only one that will get consensus.
Here is a proposal:


     1. Separate the aliasing flag from the warning flags as outlined in
        a previous post. This is prep work, status quo is preserved. In
        addition it prevents adding aliasing flag to modules that
        currently don't have it without their knowledge or consent.
     2. On a per module basis, remove the no aliasing option where there
        is a technical agreement.


It is the same concept you proposed, but the implementation is reversed
so we don't have both -fno-strict-aliasing and -fstrict-aliasing on the
same gcc command. Also note that not all modules have CWARNFLAGS in
their Makefiles.

This preserves backward compatibility as CWARNFLAGS remains intact for
previous versions of the modules.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20101101/bd18516e/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-devel/attachments/20101101/bd18516e/attachment.pgp>


More information about the xorg-devel mailing list