IsUnsigned() function?

carroll at m.cs.uiuc.edu carroll at m.cs.uiuc.edu
Wed Aug 1 23:57:00 AEST 1990


/* Written  1:22 pm  Jul 31, 1990 by henry at zoo.toronto.edu in m.cs.uiuc.edu:comp.lang.c */
In article <17181 at haddock.ima.isc.com> karl at kelp.ima.isc.com (Karl Heuer) writes:
>>Side note: can anyone out there give a good explanation as to why
>>chars were *ever* signed in the first place,
>The pdp11's byte-to-word instruction did sign extension, so it was cheaper to
>have chars be signed...
I've heard Dennis express some doubts about this decision in retrospect,
but it was a sensible thing to do at the time.
/* End of text from m.cs.uiuc.edu:comp.lang.c */
The problem was that "signed" was a valid type modifier, but "unsigned" wasn't.
If chars were (by default) unsigned, they could be made signed, but if they
were signed, they couldn't be made unsigned. This means that under K&R(1) C,
if the default char type was signed, there was no way to have unsigned chars.
IMHO, this is a problem. (Now ANSI-fixed, at least).

Alan M. Carroll                Barbara/Marilyn in '92 :
carroll at cs.uiuc.edu            + This time, why not choose the better halves?
Epoch Development Team         
CS Grad / U of Ill @ Urbana    ...{ucbvax,pur-ee,convex}!cs.uiuc.edu!carroll



More information about the Comp.lang.c mailing list