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

Alan Coopersmith alan.coopersmith at oracle.com
Fri Dec 9 10:22:25 PST 2011

On 12/09/11 10:12, Gaetan Nadon wrote:
> On Fri, 2011-12-09 at 09:52 -0800, Alan Coopersmith wrote:
>> The actual diff is:
>> -if  test"x$GCC"  = xyes ; then
>> -    XSERVER_CFLAGS="$XSERVER_CFLAGS -fno-strict-aliasing"
>> -fi
>> +XORG_TESTSET_CFLAG([NO_STRICT_ALIASING_CFLAG], [-fno-strict-aliasing])
>> 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.

Right, I was thinking about compilers which aren't detected as gcc but
which also support the flag - this would be a benefit, not a problem.
(I don't know if any such compilers exist, as Solaris Studio doesn't
  support that flag, and I thought clang was detected as gcc by configure.)

It also gives a good place to add alternative flags for other compilers
if we discover any need such flags.
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System

More information about the xorg-devel mailing list