[comp.lang.c] Difference between char and unsigne

DSTONE@WL9.Prime.COM (07/19/90)

Karl Heuer writes:

> Now, since all normal% characters are contained within the intersection of
> `char' and `unsigned char', you can safely ignore this botch if you *know*
> you're dealing with the most restrictive kind of text.

> % Besides being true of all ASCII characters, this guarantee is also extended
>   to the entire C source character set in non-ASCII alphabets.  Basically this
>   forbids an EBCDIC implementation from making `char' a signed 8-bit type.

I thought this was true, too:  but where is it in the standard?   I have
RTFS  without  success.   The  only  place  I  can  find  it is in K&R I
Reference Manual section 6.1 ("it is guaranteed that  a  member  of  the
standard character set is non-negative").

David Stone
<dstone@wl9.prime.com>
speaking for myself, and not Prime Computer.

steve@taumet.com (Stephen Clamage) (07/20/90)

DSTONE@WL9.Prime.COM writes:
>> Now, since all normal% characters are contained within the intersection of
>> `char' and `unsigned char', you can safely ignore this botch if you *know*
>> you're dealing with the most restrictive kind of text.

>> % Besides being true of all ASCII characters, this guarantee is also extended
>>   to the entire C source character set in non-ASCII alphabets.  Basically this
>>   forbids an EBCDIC implementation from making `char' a signed 8-bit type.

>I thought this was true, too:  but where is it in the standard?   I have
>RTFS  without  success.

Section 3.1.2.5:
"An object declared as type *char* is large enough to store any member of
the basic execution character set.  If a member of the required source
character set enumerated in 2.2.1 is stored in a *char* object, its
value is guaranteed to be positive."
-- 

Steve Clamage, TauMetric Corp, steve@taumet.com