int8_t typedef problem
Ralf Corsepius
corsepiu at faw.uni-ulm.de
Tue Jan 7 16:27:00 UTC 2003
Am Die, 2003-01-07 um 16.34 schrieb Joel Sherrill:
> Ralf Corsepius wrote:
> >
> > Am Die, 2003-01-07 um 15.29 schrieb Stephen Holford:
> > > Hi Joel
> > >
> > > >
> > > > Thanks. What about the other intXX_t types? Should they say signed?
> > >
> > > Not necessary as all arithmetic types other than chars and bitfields are
> > > signed by default. One thing to note with the "signed" keyword is it
> > > isn't K&R compatible,
> > Does RTEMS still support pre-ANSI C? I hope we don't and I am pretty
> > sure RTEMS will not compile using a KnR-compiler.
>
> So it wouldn't be unreasonable to put the signed keyword in the
> prototypes.
I think so.
> I also noticed the they are also defined in <sys/types.h>
Yep, SUSV3/POSIX/IEEE Std 1003.1-2001. wants them to be defined
in/available through <stdint.h>, which, for historical (pre C99) reasons
apparently overlaps with sys/types.h and potentically other files
(cf the comments in /usr/include/stdint.h from a recent Linux glibc2)
So I suspect using "typedef char int8_t" being an unfortunate and
historical overlap with recent standards, predating these standards and
being hidden by compilers using implicit "signed chars".
Ralf
More information about the users
mailing list