autoconf
[Top][All Lists]
Advanced

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

Re: AC_PROG_CC wrongly setting $GCC=yes while clang is used


From: Thomas Jahns
Subject: Re: AC_PROG_CC wrongly setting $GCC=yes while clang is used
Date: Tue, 09 Sep 2014 10:10:35 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.7.0

On 09/09/14 00:26, Russ Allbery wrote:
> Bastien Chevreux <address@hidden> writes:
>> Would it be worthwhile to forward this to the GNU compiler maintainers
>> so that they could maybe correct their course by maybe introducing a
>> define which is ‘reserved’ for telling that, yes, this is indeed a GNU
>> compiler?
> 
> That's what __GNUC__ was for.  However, from the perspective of the
> authors of the other compilers, this is a bug -- they want to be able to
> compile code that uses GCC extensions, which is why they're implementing
> those extensions.  So they *want* their compiler to be detected as capable
> of supporting GCC extensions.
> 
> So, if GCC added a new define, the other compilers would just start
> defining that symbol as well.
> 
> I'm afraid the only hope you have, if you depend on extensions that are
> not implemented by other compilers, is to test explicitly for those
> extensions.

It should also be noted that among those compilers which define __GNUC__ but may
not have all the features some author expects are earlier versions of gcc.

I'd rather not rely on $GCC for anything and rather test the feature instead.

Regards, Thomas


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


reply via email to

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