Dealing with compilers that pretend to be GCC

Marc Glisse marc.glisse@inria.fr
Tue Jan 31 18:58:00 GMT 2012


On Tue, 31 Jan 2012, Ludovic Courtès wrote:

> Hi,
>
> Chris Lattner <clattner@apple.com> skribis:
>
>> On Jan 30, 2012, at 7:56 AM, Ludovic Courtès wrote:
>>
>>> Hello,
>>>
>>> Chris Lattner <clattner@apple.com> skribis:
>>>
>>>> If fact, some do:
>>>> http://clang.llvm.org/docs/LanguageExtensions.html#feature_check
>>>
>>> That seems like a very useful approach to solve the problem.
>>>
>>> The docs say that ‘__has_builtin’ & co. are macros.  What do they expand to?
>>
>> 0 or 1.
>
> I understand.  To put it another way, how are they defined?

Compiler magic, like __LINE__ for instance? I am still not sure what you 
are asking...

Interestingly enough:
$ cat q.c
__has_builtin
$ clang -E q.c
<segfault>

-- 
Marc Glisse



More information about the Gcc mailing list