This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/2] Add __clang_has_extension to sys/cdefs.h.


On Mon, Apr 25, 2016 at 3:22 AM, Florian Weimer <fweimer@redhat.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

#ifndef __has_extension
#define __has_extension(...) 0
#endif

and that would be good enough? It seems consistent with the way
sys/cdefs.h handles macro wrappers for GCC extensions.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]