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: Useful function declarations


2005/3/6, Jeff Johnston <jjohnstn@redhat.com>:
> 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?
http://www.unix.org/single_unix_specification/

Thanks,
Shaun


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