This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [2.24 PATCH 1/3] Add utility macros for clang detection, and deprecation with messages.
- From: Paul Eggert <eggert at cs dot ucla dot edu>
- To: Zack Weinberg <zackw at panix dot com>, libc-alpha at sourceware dot org
- Cc: adhemerval dot zanella at linaro dot org, vapier at gentoo dot org, carlos at redhat dot com
- Date: Sun, 31 Jul 2016 20:29:02 -0700
- Subject: Re: [2.24 PATCH 1/3] Add utility macros for clang detection, and deprecation with messages.
- Authentication-results: sourceware.org; auth=none
- References: <cover.1469994984.git.zackw@panix.com> <096b80f58b0361a9b34b2eb92e370b0592d15971.1469994984.git.zackw@panix.com>
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.