This is the mail archive of the
mailing list for the GCC project.
Re: Dealing with compilers that pretend to be GCC
- From: ludovic dot courtes at inria dot fr (Ludovic Courtès)
- To: gcc at gcc dot gnu dot org
- Date: Thu, 19 Jan 2012 15:39:48 +0100
- Subject: Re: Dealing with compilers that pretend to be GCC
- References: <firstname.lastname@example.org> <4F182987.email@example.com>
Duncan Sands <firstname.lastname@example.org> skribis:
>> A number of compilers claim to be GCC, without actually being GCC. This
>> has come to a point where they can hardly be distinguishedâuntil one
>> actually tries to use them.
> this suggests that you shouldn't be testing for GCC, and instead should be
> testing for support for particular features. For example, to know if nested
> functions are supported you would have your configure script compile a mini
> program that uses nested functions.
Yes. The macro I posted is a feature test: it tests for plug-in header
availability, and the availability of several GCC internal types and
When I noticed that Clang doesnât support nested functions, I added that
to the test:
Yet, I canât reasonably add a feature test for each GNU extension that
GCCâs headers or my own code use. Maybe tomorrow Clang will support
nested functions, while still lacking support for some other extension