int8_t typedef problem

Joel Sherrill joel.sherrill at OARcorp.com
Tue Jan 7 15:34:54 UTC 2003



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.

RTEMS has had only ANSI prototypes for as long as I can remember.  We
can check the CVS history back to the 1995 time frame and I am pretty
sure it will be that way.

> >  it was introduced in the C89 standard.
> intXX_t types are C99.
> 
> >>From SUSV3:
> 
> <citation>
> Exact-width integer types
> 
>         The typedef name int N _t designates a signed integer type with
>         width N, no padding bits, and a two's-complement representation.
>         Thus, int8_t denotes a signed integer type with a width of
>         exactly 8 bits.
> 
>         The typedef name uint N _t designates an unsigned integer type
>         with width N. Thus, uint24_t denotes an unsigned integer type
>         with a width of exactly 24 bits.
> 
>         [CX] [Option Start] The following types are required:
> 
> 
>         int8_t
>         int16_t
>         int32_t
>         uint8_t
>         uint16_t
>         uint32_t[Option End]
> 
> 
>         If an implementation provides integer types with width 64 that
>         meet these requirements, then the following types are required:
>         int64_t uint64_t
> 
> <citation>

So it wouldn't be unreasonable to put the signed keyword in the
prototypes.

I also noticed the they are also defined in <sys/types.h>
but wrapped in a __MS_types__ which I have never quite
been comfortable enabling.

> Ralf

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985



More information about the users mailing list