This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Clean up __MALLOC_* macros
- From: Andreas Jaeger <aj at suse dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Sun, 06 Jan 2013 20:29:35 +0100
- Subject: Re: Clean up __MALLOC_* macros
- References: <Pine.LNX.4.64.1301051649470.702@digraph.polyomino.org.uk>
On 01/05/2013 05:54 PM, Joseph S. Myers wrote:
This patch cleans up one case of unnecessary __GNUC__ conditionals in
installed headers that I mentioned in recent discussions: the
conditionals in malloc.h.
__MALLOC_P and __MALLOC_PMT are used only in malloc.c so don't belong
in an installed header at all; they appear to be relics of pre-C90
compatibility and can just be replaced by their expansions wherever
they are used. __MALLOC_DEPRECATED has a definition conditional on
_LIBC; there's no need to be conditional on __GNUC__ as well, since in
the case where the expansion is nonempty it is
__attribute_deprecated__, which sys/cdefs.h defines with an expansion
depending on __GNUC__. And the definition of __MALLOC_HOOK_VOLATILE
as "volatile" is just using standard C90 syntax for declaring a
volatile pointer, so there is no need for a conditional on __GNUC__
there either.
Tested x86_64.
I agree, this looks fine,
Thanks,
Andreas
--
Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126