Long Chars

00704a-Liber nevin1 at ihlpf.ATT.COM
Wed Mar 30 10:29:44 AEST 1988


In article <7546 at brl-smoke.ARPA> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
>In article <8803250401.AA01184 at champlain.dgp.toronto.edu> flaps at dgp.toronto.edu (Alan J Rosenthal) writes:
>>Why do you need to make sizeof(char) == 2 just to make chars 16 bits?
>>Make chars 16 bits, keep sizeof(char) == 1, ...

>The idea is that you not only need to handle fat chars, you also
>have applications that need to handle smaller objects (bytes, or
>bits).  Therefore there would have to be some object type smaller
>than a char (e.g. a "short char").

This makes me think that way back when KK&R defined C, they should have
called the 'char' type a 'byte' type instead.  Because of existing
practice (whether it be good or bad, it is common), I feel that the
sizeof(char) == 1.  70% of the time that I use char I use it for doing
byte-type operations (reading in from a file, etc.).

There is a need for having a fundamental type (call it foo) such that
sizeof(foo) == 1 can be guaranteed in *ALL* implementations.  Due to
existing practice, I would like that type to be called char.  Just add
things like 'long char' to accomodate the people who need them.
-- 
 _ __			NEVIN J. LIBER	..!ihnp4!ihlpf!nevin1	(312) 510-6194
' )  )				"The secret compartment of my ring I fill
 /  / _ , __o  ____		 with an Underdog super-energy pill."
/  (_</_\/ <__/ / <_	These are solely MY opinions, not AT&T's, blah blah blah



More information about the Comp.lang.c mailing list