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 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


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