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: libc-alpha at sourceware dot org
- Cc: Roland McGrath <roland at hack dot frob dot com>
- Date: Tue, 09 Apr 2013 09:24:10 +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>
On Monday, April 08, 2013 14:20:34 Roland McGrath wrote:
> > Is this what you had in mind for stdlib.h?
>
> No, it's pretty much the opposite.
> Just "#ifdef __USE_MISC" at top-level ought to suffice.
I'm not following you, could somebody tell me where my reasoning is
wrong?
We have right now:
#if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \
|| defined __USE_SVID
<features.h> contains:
/* If nothing (other than _GNU_SOURCE) is defined,
define _BSD_SOURCE and _SVID_SOURCE. */
#if (!defined __STRICT_ANSI__ && !defined _ISOC99_SOURCE && \
!defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE && \
!defined _XOPEN_SOURCE && !defined _BSD_SOURCE && !defined
_SVID_SOURCE)
# define _BSD_SOURCE 1
# define _SVID_SOURCE 1
#endif
#if defined _BSD_SOURCE || defined _SVID_SOURCE
# define __USE_MISC 1
#endif
#ifdef _SVID_SOURCE
# define __USE_SVID 1
#endif
and the defines based on _XOPEN_SOURCE.
Compilation with just -D_XOPEN_SOURCE=600 will define:
__USE_XOPEN_EXTENDED
Compilation with just -D_XOPEN_SOURCE=700 will define:
__USE_XOPEN2K8
__USE_XOPEN_EXTENDED
But neither defines __USE_SVID or __USE_MISC.
So, I'm not following why these two should be equivalent:
#if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \
|| defined __USE_SVID
and
#ifdef __USE_MISC
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