[PATCH xserver 1/4] Replace deprecated CWARNFLAGS with BASE_CFLAGS and NO_STRICT_ALIASING_CFLAG

Gaetan Nadon memsize at videotron.ca
Fri Dec 9 10:12:54 PST 2011

On Fri, 2011-12-09 at 09:52 -0800, Alan Coopersmith wrote:

> On 12/09/11 07:40, Keith Packard wrote:
> > On Fri, 09 Dec 2011 07:45:01 -0500, Gaetan Nadon<memsize at videotron.ca>  wrote:
> >
> >>   This function is deprecated because it defines -fno-strict-aliasing
> >>   which alters the code generated by the compiler.  If -fno-strict-aliasing
> >>   is needed, then it should be added explicitly in the module when
> >>   it is updated to use BASE_CFLAGS.
> >
> > Does this change the default for this flag? -fno-strict-aliasing is
> > needed to preserve compatibility with older code, and I think it should
> > probably be on by default until a module owner disables it manually.
> The actual diff is:
> -if  test "x$GCC" = xyes ; then
> -    XSERVER_CFLAGS="$XSERVER_CFLAGS -fno-strict-aliasing"
> -fi
> which has the net effect of changing it from hardcoding for gcc to passing
> it to any compiler which accepts the flag, so many actually expand usage of
> it on non-gcc compilers.

My understanding is that XORG_TESTSET_CFLAG tests the compiler flag with
the compiler being used. During xserver configuration, I get:

        checking if gcc -std=gnu99 supports -fno-strict-aliasing... yes

I expect that the variable will be empty on non gcc compilers but I have
not tested that personally.

        # XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
        # ---------------
        # Minimum version: 1.16.0
        # Test if the compiler works when passed the given flag as a command line argument.
        # If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
        # next flag in the list until there are no more options.
        # Note that this does not guarantee that the compiler supports the flag as some
        # compilers will simply ignore arguments that they do not understand, but we do
        # attempt to weed out false positives by using -Werror=unknown-warning-option and
        # -Werror=unused-command-line-argument

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20111209/8233b24a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-devel/attachments/20111209/8233b24a/attachment.pgp>

More information about the xorg-devel mailing list