int8_t typedef problem

Ralf Corsepius corsepiu at faw.uni-ulm.de
Tue Jan 7 15:00:49 UTC 2003


Am Die, 2003-01-07 um 15.21 schrieb Joel Sherrill:
> Stephen Holford wrote:
> > 
> > Hi
> > 
> > We have come across an issue with the declaration of the int8_t type in
> > include/machine/types.h originating from newlib (but patched for rtems
> > with newlib-1.10.0-rtems-20021127.diff).
> > 
> > Currently it is defined as:
> > 
> > typedef char               int8_t;
> > 
> > The problem is that on some targets (like the powerpc) the default type
> > for a char is unsigned. So the above should read:
> > 
> > typedef signed char      int8_t;
> > 
> > to ensure that there is no ambiguity.
> 
> Thanks.  What about the other intXX_t types?  Should they say signed?
Yes, IIRC, all int*_t should be signed, all uint*_t should be unsigned.

I currently don't have SUSV3 at hand (I seem to have lost the official
link, and my local copy currently is unaccessable), but IIRC, it
contains a section on this topic somewhere.

Ralf





More information about the users mailing list