draft ANSI standard: one change that would *really* help Europe

Joe Mueller joemu at nscpdc.NSC.COM
Fri Dec 5 03:47:24 AEST 1986


> >[We really need an 8-bit character set and C needs to acknowledge this]
> 
> >[John thinks that perhaps "char" should be unsigned - most programs
>   would be more correct since they assUme that chars are unsigned]
> 
> Well, I heartily agree, but I think that there must be some programs
> out there that assume that chars are useful as small signed numbers,
> which I would also prefer not to break.  
> 
> Also, I think that having chars have different semantics (assumed unsigned
> rather than signed like int) would be a bad thing in general.  Perhaps
> what is needed is a "tiny" type (ala long and short) that would be signed
> and (for now) essentially a signed char.
> 
> Of course, this brings in yet another type (oh no!) and yet another
> reserved word, but it would make programs nicer.
> 	andy

Andy, 

The standard does allow for a small signed char type called (would you believe)
"signed char". From section 3.1.2.5 of the draft dated Oct. 1, 1986.

	A signed char occupies the same amount of storage as a "plain" char.
	A "plain" int has the natural size suggested by the architecture of the
	execution environment ...

The committee wanted to "fix" the question of signedness of a char but couldn't
arrive at an acceptable compromise. We thought about having chars be signed
and unsigned chars unsigned but we were afraid it would break too much code that
depended on chars being unsigned. We ended up adopting the compromise of:
	char	- signed or unsigned, implementation defined
	unsigned char
	signed char

By the way, the draft is now released for formal public review, so if you
have any other technical comment, fire away now or it will be too late!

					a humble member of X3J11,
					Joe Mueller
					...!nsc!nscpdc!joemu



More information about the Comp.lang.c mailing list