Re: What is the point of signed char?
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Thu, 21 Jul 2005 19:16:29 GMT
"Peter Nilsson" <airia@xxxxxxxxxxx> writes:
> Lawrence Kirby wrote:
>> On Tue, 19 Jul 2005 05:10:55 -0700, ng5000 wrote:
>> > ...
>> > If I'm worried about space then I could use int8_t (from
>> > C99 stdint.h).
>>
>> If int8_t exists then char must be an 8 bit type on that system. It
>> is very likely that where it exists int8_t will be typedef'd as char
>> or signed char. ...
>
> I don't think that int8_t can be typedef'd as (plain) char in the
> strictest sense. C99 states that "int8_t denotes a signed integer
> type...", however plain char is not a signed integer type (per
> 6.2.5p4).
>
> That said, the 'as if' rule applies!
If you're correct that int8_t can't be typedef'ed as plain char, the
"as if" rule doesn't apply. The following would be illegal:
int8_t *iptr;
unsigned char *cptr;
cptr = iptr;
--
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.
.
- Follow-Ups:
- Re: What is the point of signed char?
- From: Peter Nilsson
- Re: What is the point of signed char?
- References:
- What is the point of signed char?
- From: ng5000
- Re: What is the point of signed char?
- From: junky_fellow
- Re: What is the point of signed char?
- From: ng5000
- Re: What is the point of signed char?
- From: Lawrence Kirby
- Re: What is the point of signed char?
- From: Peter Nilsson
- What is the point of signed char?
- Prev by Date: Re: What is the point of signed char?
- Next by Date: Re: how to create huge two-dementional array
- Previous by thread: Re: What is the point of signed char?
- Next by thread: Re: What is the point of signed char?
- Index(es):
Relevant Pages
|
|