((c = getc(stdin)) == EOF) retractio - (nf)

mwm at ea.UUCP mwm at ea.UUCP
Sat Jun 9 05:17:00 AEST 1984


#R:basser:-31000:ea:13500017:000:1200
ea!mwm    Jun  8 14:17:00 1984

/***** ea:net.unix-wizar / basser!chris /  7:28 pm  Jun  3, 1984 */
It's my personal belief (and one I believe is shared by Mr Ritchie) that
C compilers which take the easy way out for their architecture by making
"char"s unsigned are unfortunate.  After all, what is the difference
between "char" and "unsigned char" with such compilers, and how are you
supposed to use 8 bit signed integers, except by hand? 

Chris Maltby
University of Sydney.
/* ---------- */

What you are really running into is a fundamental problem in C: it doesn't
distinguish between characters and numbers. I mean, what is an unsigned
character? How do I attach a sign to the character 'A'?

What you want are short integers. It was my impression that this is what
the "short" data type was for. You shouldn't be using chars as integers,
whether signed or unsigned. If you need to use the address unit of the
machine (which might or might not be char, and both it and char might or
might not be 8 bits long), you are forced by C to use char.

That is where the problem lies. C needs an explicit type for the address
unit (byte?), that is normally signed, but can be made unsigned.

	Signed chars considered harmful,
	<mike



More information about the Comp.unix.wizards mailing list