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: Clean up __MALLOC_* macros


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


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