Long Chars

Doug Gwyn gwyn at brl-smoke.ARPA
Thu Mar 31 03:05:06 AEST 1988


In article <4191 at ihlpf.ATT.COM> nevin1 at ihlpf.UUCP (00704a-Liber,N.J.) writes:
>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.

sizeof(bit)==1 can be guaranteed universally.

If you mean addressable object, there is no single size universally
supported by computer hardware.

The problem with preempting "char" for small objects is that most C
code thinks that a "char" is big enough to hold a primitive unit of
text.  This is plainly wrong in some environments unless "char" is
made pretty large.  (It needs to be 16 bits for Imagen's GASCII, for
example.)  "char" cannot play both roles at once, and "long char" is
contrary to the current use of "char" majority of existing code (as
well as requiring a whole slew of lstr*() library functions).



More information about the Comp.lang.c mailing list