This is the mail archive of the
mailing list for the GCC project.
Re: Dealing with compilers that pretend to be GCC
On 20/01/2012 23:28, Jonathan Wakely wrote:
> 2012/1/20 Ludovic Courtès:
>> Yeah, but it’s a shame that those compilers define __GNUC__ without
>> supporting 100% of the GNU C extensions. With this approach, you would
>> also need to add !defined for Clang, PGI, and probably others.
> May I politely suggest that this is the wrong place to complain about
> other compilers pretending to be GCC :)
> If GCC added a __REALLY_GNUC__ macro the other compilers would define
> it, for exactly the same reasons they define __GNUC__
I do agree with the proposition that if you pretend to be GCC, but don't do
it completely and well enough, that's a bug that should be fixed in the
compiler pretending to be GCC.
OTOH the entire point of autotools is that any toolchain (even GCC itself)
sometimes has bugs or unimplemented features, and you just can't argue with
the principle that the definitive test is always going to be "try and use the
feature and verify if it worked or not". Therefore autoconf tests should not
just test __GNUC__, unless the only thing they're trying to be a test for is
whether __GUNC__ is defined or not.