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: bz#15007: Fix mismatch of guards for qecvt


On 04/11/2013 11:16 PM, Roland McGrath wrote:
> [...]
The original intent of all the __USE_* macros was that they would always be
used singly.  That's why we have __USE_MISC at all instead of just using
"#if defined __USE_BSD || defined __USE_SVID" everywhere.  That is, all the
headers would only ever have simple "#ifdef __USE_FOO" conditionals (never
nested), specifically so that features.h is the one and only place where
all the complex interrelationships have to be understood.  The hope was to
avoid ever dealing with exactly the kind of confusion we are having now.
But this has now become quite muddled.

It would be a worthy project for someone to go in and clean this all up
again.  All the interactions probably necessitate some new __USE_* macros
at finer grain.  But the situation can probably be simplified nowadays
because I think we could drop _BSD_SOURCE and _SVID_SOURCE entirely from
the API (they've gone the way of K&R C).  For all modern source code, it
seems reasonable enough to support just the various standard-specified
feature macros plus _GNU_SOURCE.  (By implication we'd drop __FAVOR_BSD and
the things it enables.  For struct tcphdr/udphdr we could perhaps use some
anonymous unions to support both the original (BSD) and the Linuxoid field
names.)

I'm adding this to the wiki at:
http://sourceware.org/glibc/wiki/Development_Todo/Master#Cleanup

thanks for the explanation,
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]