Useful function declarations

Shaun Jackman
Thu Sep 29 20:40:00 GMT 2005

2005/3/6, Jeff Johnston <>:
> Shaun Jackman wrote:
> >>Ok.  Are you willing to put together a patch?  My preference would be a
> >>symbol that is unlikely to be used by something else like gcc (e.g..
> >>prefix with __newlib_).  If optional, it should be put in the newlib.h
> >>header file.
> >
> > I'd be happy to put the patch together. I'd already started doing this
> > using __ARM_ARCH_4T__ -- just because the symbol was handy -- so I'll
> > just fix up the patch to use a more appropriate symbol. My inclination
> > is to use __newilb_susv3.
> >
> Sounds reasonable with typo fixed :)

I've started to revisit this matter of function declarations and
appropriate armouring. Here's the criteria I'd like to use...

* If the function is defined by ANSI C, use no armouring.
* If the function is not defined by ANSI, but defined by SUSv3, use
#ifndef __STRICT_ANSI__ (defined by GCC for -ansi).
* If the function is defined by SUSv3 as a XSI (X/Open System
Interfaces) extension, use #ifdef __USE_XOPEN (as glibc does) or
perhaps #ifdef __NEWLIB_XOPEN as we were discussing earlier.
* If the function is not defined by SUSv3 at all, use an appropriate
#ifdef __USE_xxx (or __NEWLIB_xxx) such as __USE_BSD.

My preference is to use the same __USE_xxx macros as glibc does. What
do you think, Jeff?

Can someone point me to a good online copy of the ANSI C
specification, similar to the Single UNIX Specification?


More information about the Newlib mailing list