This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH 1/2] Add __clang_has_extension to sys/cdefs.h.
- From: Zack Weinberg <zackw at panix dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 25 Apr 2016 09:57:18 -0400
- Subject: Re: [PATCH 1/2] Add __clang_has_extension to sys/cdefs.h.
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1461444595 dot git dot zackw at panix dot com> <7d28608ab5396836526b235526e0b757236cfc85 dot 1461444595 dot git dot zackw at panix dot com> <571DC5D1 dot 5070209 at redhat dot com>
On Mon, Apr 25, 2016 at 3:22 AM, Florian Weimer <email@example.com> wrote:
> On 04/23/2016 01:05 AM, Zack Weinberg wrote:
>> * misc/sys/cdefs.h: New utility macro __clang_has_extension.
> I don't feel strongly about this, but the identifier looks like it's in the
> Clang namespace. Perhaps use __glibc_clang_has_extension instead?
That's a good point, but I think the name __glibc_clang_has_extension is
far too clunky to tolerate.
Experimenting, clang treats __has_extension as an intrinsic *macro* --
for instance, #ifdef __has_extension is true. So maybe we could just do
#define __has_extension(...) 0
and that would be good enough? It seems consistent with the way
sys/cdefs.h handles macro wrappers for GCC extensions.