bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AC_HEADER_STDBOOL fails with clang


From: Eric Blake
Subject: Re: AC_HEADER_STDBOOL fails with clang
Date: Mon, 23 Aug 2010 10:36:54 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100806 Fedora/3.1.2-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.2

On 08/23/2010 10:27 AM, Paul Eggert wrote:
On 08/23/10 09:14, Eric Blake wrote:
So does clang define __GNUC__?  That's a lie, if it does not support the
same extensions as gcc.

Yes, and this lie causes a lot of problems in practice:
clang does not support many extensions that GCC does support.
The usual workaround is to replace "defined __GNUC__" with
"defined __GNUC__&&  ! defined __clang__", but this sort of
thing is obviously not The Autoconf Way.  It is better, in
general, to avoid the use of __GNUC__ entirely.  In this
particular case, where the __GNUC__ is gratuitous, I'd remove
the __GNUC__ (while also replacing the -1 with 0 as Eric suggests).

But that particular __GNUC__ use was _not_ gratuitous. That piece of code uses non-standard C, so we wanted to limit compilation to exactly two compilers: AIX, to expose the compiler bug; and gcc, where we know that the extension is supported, to make sure we don't introduce a future regression that could have been detected by gcc (and in case the AIX compiler is ever fixed). Now we have to deal with clang also compiling the same bit of code.

--
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]