Why unsigned chars not default?

carroll at s.cs.uiuc.edu carroll at s.cs.uiuc.edu
Mon Oct 24 02:29:00 AEST 1988


In article <9563 at pur-ee.UUCP> mendozag at ee.ecn.purdue.edu (Victor M Grado) writes:
- (...)  He claims the compilers are at fault and that all the compilers
- should have 'unsigned char' as default for characters (...)

Absolutely not! The reason is that 'unsigned' is a keyword in C, and
'signed' is not. I got screwed by this porting stuff to the 3b systems,
where unsigned in the default, but the code thought signed was the
default. There is no way to fix that. Where as, if you assumed unsigned,
you merely have to put the 'unsigned' keyword in front of your chars.
FLAME ON -
This bug shows up in 'units', where the exponents are stored in chars,
*signed* chars. On a 3b, this means that units can't deal with negative
powers of dimensions, which is somewhat of a fatal flaw. Although there is
a simple fix (change 'char' to 'short int'), AT&T, through several releases,
*still* hasn't gotten it to work. Who knows what other bugs are floating around
because of something like this?
FLAME OFF

Alan M. Carroll          "How many danger signs did you ignore?
carroll at s.cs.uiuc.edu     How many times had you heard it all before?" - AP&EW
CS Grad / U of Ill @ Urbana    ...{ucbvax,pur-ee,convex}!s.cs.uiuc.edu!carroll



More information about the Comp.lang.c mailing list