This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Remove _BSD_SOURCE and _SVID_SOURCE
- From: Rich Felker <dalias at aerifal dot cx>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 5 Dec 2013 21:33:46 -0500
- Subject: Re: Remove _BSD_SOURCE and _SVID_SOURCE
- Authentication-results: sourceware.org; auth=none
- References: <Pine dot LNX dot 4 dot 64 dot 1312052315530 dot 16480 at digraph dot polyomino dot org dot uk>
On Thu, Dec 05, 2013 at 11:17:59PM +0000, Joseph S. Myers wrote:
> In more detail:
>
> The status quo is that the features enabled by _BSD_SOURCE or
> _SVID_SOURCE are enabled (a) if the applicable one of those macros is
> defined by the user (a case that will no longer be supported), (b) by
> default, if the user didn't use a compiler option such as -ansi or
> -std=c99 that defines __STRICT_ANSI__ and didn't define
> _ISOC99_SOURCE, _POSIX_SOURCE, _POSIX_C_SOURCE or _XOPEN_SOURCE (or
> _BSD_SOURCE or _SVID_SOURCE), (c) if _GNU_SOURCE is defined. There's
> the oddity of (b) not checking _ISOC11_SOURCE, but it's not the
> function of this patch to change anything in that regard.
I'm not 100% against this change, but how do you propose getting the
current default profile of what's exposed in the header along with
correct C semantics at the compiler level? -std=c99 and -std=c11,
which are needed to get the compiler to behave right (gnu99 has lots
of problems), define __STRICT_ANSI__ which inhibits all the default
features. -U__STRICT_ANSI__ might work but this seems hackish...
Rich