stdint.h

Corinna Vinschen vinschen@redhat.com
Mon Jul 7 18:57:00 GMT 2003


On Thu, Jul 03, 2003 at 04:02:09PM -0400, J. Johnston wrote:
> Shaun Jackman wrote:
> >Well, now that the stdbool.h thread has died, I'd like to look at the
> >original reason for that thread in the first place. gcc does not provide
> >stdint.h (since it's target dependent), which would suggest it's a good
> >candidate for newlib to provide. The not-so-pretty list of symbols that
> >stdint.h is supposed to provide follows. libc provides an implementation
> >of stdint.h. Perhaps we could use that as a starting point.
> >
> 
> Disregarding the whole issue of whether gcc should provide this header file:
> 
> If you are referring to copying glibc as a starting-point, you cannot do 
> that.  That code is
> LGPL'd and newlib does not place LGPL'd code in directories that are shared 
> among platforms.
> 
> Although tedious, it should be reasonably straighforward to add one to
> newlib.
> 
> My thoughts are that stdint.h would start by including <sys/types.h>.
> This provides the base __intx_t and __unintx_t definitions.  We would need 
> to add
> default __ least/fast types to <sys/types.h> which could default to be the 
> intx/uintx types.
> Any platform that wanted to change these definitions could do so by 
> overriding
> the definitions in <machine/types.h>.  Obviously, we would need to protect
> the type definitions with flags and ensure that things were
> defined after <machine/types.h> was included by <sys/types.h>.
> 
> For the MAX/MIN values, we can code the constant values as __ values with
> checks to ensure they are not already defined.  stdint.h would then map the
> external names to their __ counterparts.  Any platform can again override 
> using <machine/types.h>.

As a side note, Cygwin already provides a stdint.h and a inttypes.h in
sourceware's src/winsup/cygwin/include.  It could be used as a start point.
There's no problem removing the Cygwin licensing hint from the files.
It would just be nice if the newlib version doesn't collide with the
Cygwin version in a way which destroys anything, e. g. the ability to
build Cygwin.

Corinna

-- 
Corinna Vinschen
Cygwin Developer
Red Hat, Inc.
mailto:vinschen@redhat.com



More information about the Newlib mailing list