This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: __has_include__ is problematic
- From: Florian Weimer <fweimer at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 10 Jan 2019 15:35:14 +0100
- Subject: Re: __has_include__ is problematic
- References: <87ef9kk304.fsf@oldenburg2.str.redhat.com> <20190110143230.GX30353@tucnak>
* Jakub Jelinek:
> On Thu, Jan 10, 2019 at 03:20:59PM +0100, Florian Weimer wrote:
>> Can we remove __has_include__?
>
> No.
>
>> Its availability results in code which is needlessly non-portable
>> because for some reason, people write __has_include__ instead of
>> __has_include. (I don't think there is any difference.)
>
> __has_include needs to be a macro, while __has_include__ is a weirdo
> builtin that does all the magic. But one needs to be able to
> #ifdef __has_include
> etc.
Why doesn't a synthetic
#define __has_include __has_include
work?
Thanks,
Florian