This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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: strerror_r questions


On 02/10/2011 02:47 AM, Corinna Vinschen wrote:
>> +#ifdef _GNU_SOURCE
> 
> I would still prefer if we could use the same #if expression as
> documented in glibc's `man strerror_r':
> 
>   (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && ! _GNU_SOURCE
> 
> But we can't do that right now because our features.h defines
> _POSIX_C_SOURCE very different from glibc.
> 
> In newlib, _POSIX_C_SOURCE is *only* defined automatically, if
> _XOPEN_SOURCE is defined.
> 
> In glibc, _POSIX_C_SOURCE is always defined automatically, *unless*
> _XOPEN_SOURCE has a value >= 500, and the default value is 200809L,
> aka POSIX1-2008.
> 
> I think we should fix that.  However, this doesn't affect this patch
> immediately, so, please check it in.

Agreed - there's no way to change the #if line in newlib to match
glibc's behavior until we also change newlib's automatic defines; and
that would have a far-more-reaching scope (all newlib headers would have
to be scrubbed for which conditions to use for which functions), so I
pushed the patch as-is without modifying the #if line.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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