This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: bz#15007: Fix mismatch of guards for qecvt
- From: Andreas Jaeger <aj at suse dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 26 Apr 2013 16:10:22 +0200
- Subject: Re: bz#15007: Fix mismatch of guards for qecvt
- References: <515C5F33 dot 3070705 at suse dot com> <2678974 dot ZlRiEFqKvM at byrd> <20130408212034 dot 3B1332C085 at topped-with-meat dot com> <3912486 dot KZmDiiDHMs at byrd> <20130411211623 dot 213B02C086 at topped-with-meat dot com>
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