Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: Notesfiles; site ea.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!ihnp4!inuxc!pur-ee!uiucdcs!ea!mwm From: mwm@ea.UUCP Newsgroups: net.unix-wizards Subject: Re: ((c = getc(stdin)) == EOF) retractio - (nf) Message-ID: <13500017@ea.UUCP> Date: Fri, 8-Jun-84 15:17:00 EDT Article-I.D.: ea.13500017 Posted: Fri Jun 8 15:17:00 1984 Date-Received: Mon, 11-Jun-84 00:23:05 EDT References: <310@basser.UUCP> Lines: 29 Nf-ID: #R:basser:-31000:ea:13500017:000:1200 Nf-From: ea!mwm Jun 8 14:17:00 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,