Long Chars

Alan J Rosenthal flaps at dgp.toronto.edu
Fri Mar 25 14:01:16 AEST 1988


*sigh*... it took me a full year of the start of my C career to decide
finally that sizeof(char) really was guaranteed to be 1, due to the
constraint that all objects were made up of chars (i.e. a char * can
traverse any object), recently formally formalized by ANSI, previously
informally formalized by the existence of memcpy() / bcopy() and friends.

Why do you need to make sizeof(char) == 2 just to make chars 16 bits?
Make chars 16 bits, keep sizeof(char) == 1, also make sizeof(int) == 1
and sizeof(long) == 2, etc.  If ANSI requires plain char to be signed in
all implementations in which sizeof(char) == sizeof(int), we're all set.

ajr
-- 
If you had eternal life, would you be able to say all the integers?



More information about the Comp.lang.c mailing list