Re: gcc 4 signed vs unsigned char
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Thu, 28 Jul 2005 08:01:59 GMT
juanitofoo@xxxxxxxxx writes:
> I thougth that using int8_t would be more portable. Anyway, in my code
> I also use int8_t, int16_t, int32_t (and their unsigned versions)
> instead of using int, short, long ... Should I use the intx_t or the
> int, short, etc? My main aim is portability among platforms.
Use whatever type is appropriate to your task. If you need an 8-bit
2's-complement type with no padding bits, use int8_t (assuming you
have a C99 implementation) -- but chances are you don't really need
all those properties.
If you need a signed type that's at least 16 bits, use int_least16_t.
Or use int.
And if you need to represent characters, use char; that's what it's
for.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.
- References:
- Re: gcc 4 signed vs unsigned char
- From: juanitofoo
- Re: gcc 4 signed vs unsigned char
- From: Clark S . Cox III
- Re: gcc 4 signed vs unsigned char
- From: juanitofoo
- Re: gcc 4 signed vs unsigned char
- Prev by Date: Re: fexception handling in C
- Next by Date: Use of 'extern' keyword
- Previous by thread: Re: gcc 4 signed vs unsigned char
- Next by thread: Re: gcc 4 signed vs unsigned char
- Index(es):
Relevant Pages
|
|