RTEMS patch sweep: stdint.h/inttypes.h

Ralf Corsepius ralf.corsepius@rtems.org
Mon Mar 7 15:47:00 GMT 2005

On Mon, 2005-03-07 at 06:24 -0600, Joel Sherrill  wrote:
> Jeff Johnston wrote:
> > Hi Nicholas.  See the discussion this last week on the list.  It was 
> > initially RTEMS only, but it was suggested it be made shared as the 
> > defines will be needed by other non-rtems builds.  Corinna has been part 
> > of the conversation.  If Cygwin needs to revert or modify it, I'm ok 
> > with Corinna doing that.  I will be away this next week and am getting 
> > ready to leave right now.
> > 
> > There already is machine header directories per platform in newlib so 
> > perhaps I do not understand your request.
> > 
> > -- Jeff J.
> > 
> > Nicholas Wourms wrote:
> > 
> >> Why is machine/_types.h in a shared directory?
> Why shouldn't it be?  For the most part, the type definitions are CPU 
> and multilib variant dependent.

More precisely: Sizes of fixed size types are compiler and compilation
flag dependent, i.e. there exist types which change their size depending
on the version of compiler being used and there exist types which change
their size depending on the CFLAGS being used.

> >> However, it seems the damage is done, so I've come up with another 
> >> idea.  A better soultion would be to add a "machine" directory for 
> >> each platform and put it there.  That way, each platform could modify 
> >> it to their needs.  This is how GLIBC does it, so I see no reason why 
> >> we can't.
> WIthout knowing why glibc did what it did, why is it necessary to
> duplicate all those definitions?
Neither do I know why they did it the way they did it. I guess they
adopted the approach BSD applied, which as far as I can tell has
historical reasons.

Their approach is compelling for a few targets and a few compilers, but
can easily evolve into hell if using a dozen compilers and targets, like
we do.

> >> Cheers,
> >> Nicholas
> >>
> >> P.S. - I'm sorry if I sound a little cranky, it's just that I've been 
> >> working on a cygwin project for 6 months now to add a whole bunch of 
> >> c99 extensions.  As part of this, I had to create a file of the same 
> >> name, but I put it in winsup/cygwin/include/machine/_types.h.

Then I'd propose you to merge your work into newlib, should it be

Besides this, modern code should not use the types from machine/_types.h
but use the official, documented types from sys/types.h or

To such code, changes like machine/_types.h in newlib should be
transparent. If this doesn't work, this would qualify as bug somewhere
and should be fixed (I know my machine/_types.h is incomplete in
comparison to the one in BSD, but .. normal code should not use it and
it can easily be extended if really necessary.)


More information about the Newlib mailing list