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: Russ Allbery
Subject: Re: AC_PROG_CC wrongly setting $GCC=yes while clang is used
Date: Mon, 08 Sep 2014 15:26:18 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

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.

-- 
Russ Allbery (address@hidden)              <http://www.eyrie.org/~eagle/>



reply via email to

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