This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: sys/types.h int8_t signed or unsigned
- From: Shaun Jackman <sjackman at pathwayconnect dot com>
- To: "J. Johnston" <jjohnstn at redhat dot com>
- Cc: newlib at sources dot redhat dot com
- Date: 02 Jul 2003 13:44:08 -0600
- Subject: Re: sys/types.h int8_t signed or unsigned
- Organization: Pathway Connectivity
- References: <1057079187.3121.66.camel@bluesteel.pathway> <3F032C5F.9010405@redhat.com>
I'm not sure what sort of portability problems might affect this sort of
file, but here's a super-simple first pass. It can be made complicated
as people find necessary. Also, I don't have access to the C99 standard,
so I'm not sure what's actually supposed to go in this file. For now I
have uint*_t and int*_t.
Cheers,
Shaun
#ifndef _STDINT_H_
#define _STDINT_H_
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed int int32_t;
typedef signed long long int64_t;
#endif
On Wed, 2003-07-02 at 13:02, J. Johnston wrote:
> Shaun Jackman wrote:
> > In newlib-1.11.0 int8_t is defined as
> > typedef char int8_t;
> >
> > Out of curiosity, is char known to be signed? I thought it was ambiguous
> > (signed or unsigned depending on the platform). In which case this
> > should be
> > typedef signed char int8_t;
> >
>
> You are correct. I will change this.
>
> > Also, newlib doesn't provide stdint.h. Should it?
> >
>
> Newlib is not C99 (or POSIX) so it technically does not have to provide stdint.h. Would it be
> nice and/or useful to have? Definitely. We have it for linux as it simply includes <sys/types.h>.
> I can eventually add it or would you like to take a stab at implementing the shared version?
>
> -- Jeff J.