Proper Conditionals for POSIX CX and XSI

Joseph S. Myers joseph@codesourcery.com
Thu Jul 18 14:49:00 GMT 2013


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



More information about the Newlib mailing list