characters

Henry Spencer henry at zoo.toronto.edu
Wed Sep 19 02:24:07 AEST 1990


In article <2517 at idunno.Princeton.EDU> pfalstad at phoenix.Princeton.EDU (Paul John Falstad) writes:
>I, for one, loathe the concept of signed chars.  I've wasted countless
>hours of programming time searching for bugs caused because I forgot that
>chars are signed by default.  I think chars (in fact, all integer types)
>should be unsigned by default.  Comments?

I believe I've heard Dennis Ritchie say that he'd consider making char
unsigned if he had to do it all over again.

Extending this to the rest of the integer types is silly, unless you
stop calling them (e.g.) "int" and make it, say, "nat" instead.  People
have this strange impression that something called "int" should behave
somewhat like an integer, and integers are signed by definition.  (The
difference between natural numbers and integers is the inclusion of
negative numbers.)
-- 
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