characters

Henry Spencer henry at zoo.toronto.edu
Fri Sep 21 01:54:15 AEST 1990


In article <2657 at idunno.Princeton.EDU> pfalstad at phoenix.Princeton.EDU (Paul John Falstad) writes:
>Incidentally, someone sent me mail saying that neither K&R nor ANSI
>specify that chars must be signed.  True?

Correct.  On some machines, like the IBM 360/370 series -- *not* an uncommon
machine, and yes, there are C compilers (and even Unix systems) for it --
you take a major performance hit if you insist that char must be signed.
Char is signed or unsigned, whichever is faster.  Programs should avoid
depending on the specific choice.  (It's not hard when you try.)

>All the implementations I've come
>across have chars signed, however, which is the only fact I'm interested
>in.

I assume, then, that you are not interested in making your code portable.
Sooner or later you *will* encounter an unsigned-char machine; refusing
to prepare for this event guarantees that it will be traumatic.
-- 
TCP/IP: handling tomorrow's loads today| Henry Spencer at U of Toronto Zoology
OSI: handling yesterday's loads someday|  henry at zoo.toronto.edu   utzoo!henry



More information about the Comp.lang.c mailing list