Dealing with compilers that pretend to be GCC

Ludovic Courtès ludovic.courtes@inria.fr
Fri Jan 20 22:42:00 GMT 2012


Hi Vincent,

Vincent Lefevre <vincent+gcc@vinc17.org> skribis:

> For ICC, one can test __ICC. For instance, here's what we have in mpfr.h
> (for the use of __builtin_constant_p and __extension__ ({ ... })):
>
> #if defined (__GNUC__) && !defined(__ICC) && !defined(__cplusplus)

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.

Thanks,
Ludo’.



More information about the Gcc mailing list