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

Florian Weimer fweimer@redhat.com
Tue Apr 26 13:48:00 GMT 2016


On 04/25/2016 03:57 PM, Zack Weinberg wrote:

> 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?

This will confuse application that checks for the presence of 
__has_extension.  glibc should not provide compiler-defined macros 
coming from non-GNU compilers because it will be difficult to coordinate 
with these parties (it's sometimes even difficult with GCC).

Florian



More information about the Libc-alpha mailing list