This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Proper Conditionals for POSIX CX and XSI
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Joel Sherrill <joel dot sherrill at oarcorp dot com>
- Cc: "Yaakov (Cygwin/X)" <yselkowitz at users dot sourceforge dot net>, "newlib at sourceware dot org" <newlib at sourceware dot org>
- Date: Thu, 18 Jul 2013 14:49:15 +0000
- Subject: Re: Proper Conditionals for POSIX CX and XSI
- References: <51E6FFD2 dot 3030000 at oarcorp dot com> <51E76BEC dot 4080200 at users dot sourceforge dot net> <51E73D3D dot 6000809 at embedded-brains dot de> <51E7A0E6 dot 2020208 at users dot sourceforge dot net> <51E7FD15 dot 7010401 at oarcorp dot com>
On Thu, 18 Jul 2013, Joel Sherrill wrote:
> FWIW glibc uses this for memccpy() which is an XSI routine. It is
> not protected in newlib:
>
> #if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN
> extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
> int __c, size_t __n)
> __THROW __nonnull ((1, 2));
> #endif /* SVID. */
There are a great many bugs in the header conditionals in glibc. You
should refer to the relevant standards in each case rather than assuming
the glibc headers are correct.
--
Joseph S. Myers
joseph@codesourcery.com