Dealing with compilers that pretend to be GCC
Chris Lattner
clattner@apple.com
Tue Jan 31 22:46:00 GMT 2012
On Jan 31, 2012, at 4:58 AM, Marc Glisse wrote:
>>>> 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...
Yes, they are compiler magic. __has_attribute() __has_extension() etc all work the same way as well.
> Interestingly enough:
> $ cat q.c
> __has_builtin
> $ clang -E q.c
> <segfault>
Nice catch, fixed in r149397. Thanks!
-Chris
More information about the Gcc
mailing list