strerror_r questions
Eric Blake
eblake@redhat.com
Thu Feb 10 16:54:00 GMT 2011
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://sourceware.org/pipermail/newlib/attachments/20110210/08cbb3e9/attachment.sig>
More information about the Newlib
mailing list