sizeof(char)

Kim Chr. Madsen kimcm at olamb.UUCP
Fri Nov 7 02:03:01 AEST 1986


In article <5141 at brl-smoke.ARPA>, gwyn at brl-smoke.ARPA (Doug Gwyn ) writes:
] 
] X3J11 as it stands requires sizeof(char)==1.  I have proposed that
] this requirement be removed, to better support applications such as
] Asian character sets and bitmap display programming.  Along with
] this, I proposed a new data type such that sizeof(short char)==1.
] It turns out that the current draft proposed standard has to be
] changed very little to support this distinction between character
] objects (char) and smallest-addressable objects (short char).  This
] is much better, I think, than a proposal that introduced (long char)
] for text characters.
] 
] Unfortunately, much existing C code believes that "char" means "byte".
] My proposal would allow implementors the freedom to decide whether
] supporting this existing practice is more important than the benefits

Why not take the full step and let the datatype char be of variable size,
like int's and other types. Then invent the datatype ``byte'' which is exactly
8 bits long.

Do I hear you say it would break existing C-code, well so would the introduction
of ``short char''.... 

					<Kim Chr. Madsen>



More information about the Comp.lang.c mailing list