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: [2.24 PATCH 1/3] Add utility macros for clang detection, and deprecation with messages.


Zack Weinberg wrote:
+#if __GNUC_PREREQ (4,5) || \
+    __glibc_clang_has_extension (__attribute_deprecated_with_message__)

This sort of condition should be reworded to be simpler, like this:

#if __glibc_has_extension (__attribute_deprecated_with_message__)

with an implementation that looks something like this:

#ifdef __has_extension
# define __glibc_has_extension(ext) __has_extension (ext)
#else
# define __glibc_has_extension(ext) __glibc_has_extension##ext
# define __glibc_has_extension__attribute_deprecated_with_message__ __GNUC_PREREQ (4,5)
#endif

This will be easier to maintain, as only the implementation will need to worry about GCC version numbers.


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