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: Carlos O'Donell <carlos at redhat dot com>
- 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
- Date: Mon, 1 Aug 2016 16:09:42 -0400
- 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>
On 07/31/2016 04:09 PM, Zack Weinberg wrote:
> There are three new macros added to features.h and sys/cdefs.h:
>
> * __glibc_clang_prereq: just like __GNUC_PREREQ, but for clang.
> * __glibc_clang_has_extension: wraps clang's intrinsic __has_extension.
> Writing "#if defined __clang__ && __has_extension (...)" doesn't work,
> because compilers other than clang will object to the unknown macro
> __has_extension even though they don't need to evaluate it.
> Instead, write "#if __glibc_clang_has_extension (...)".
>
> * __attribute_deprecated_msg__(msg): like __attribute_deprecated__, but
> if possible, prints a message.
>
> The first two are used to define the third. The third will be used
> in subsequent patches.
>
> ChangeLog:
> * include/features.h (__glibc_clang_prereq): New macro.
> * misc/sys/cdefs.h (__glibc_clang_has_extension)
> (__attribute_deprecated_msg__): New macros.
This looks good to me. I have no objections like Roland or Paul about
abstracting this into some generic infrastructure. These things should
grow organically based on need IMO.
--
Cheers,
Carlos.