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 04/26/2016 06:48 AM, Florian Weimer wrote:

This will confuse application that checks for the presence of __has_extension.

Yes. As an example of this sort of thing, GNU Emacs does this:

   #ifndef __has_attribute
   # define __has_attribute(a) __has_attribute_##a
# define __has_attribute_alloc_size (4 < __GNUC__ + (3 <= __GNUC_MINOR__))
   # define __has_attribute_cleanup (3 < __GNUC__ + (4 <= __GNUC_MINOR__))
   ...

and this would stop working if Glibc sys/cdefs.h defined __has_attribute(x) to be 0 when compiling with GCC. This specific example is about __has_attribute and not __has_extension, but the same idea applies to __has_extension.


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