uses of void

Guy Harris guy at sun.uucp
Tue Aug 19 17:09:34 AEST 1986


> >The "abstract units" of sizeof() are "char" by definition.  (Too many users
> >have been assuming sizeof(char)==1, so it's official in C++ and ANSI C.
> 
> Don't be too sure that this won't change by the time of the final X3J11
> standard.  The internationalization issue has yet to be resolved, and
> my sense is that the cleanest way to do that will to be to distinguish
> between the basic data chunk size and a datum that can hold a character
> representation.

Not clear.  Widening "char" to support Kanji would be disruptive and cut
performance in applications that need not deal with individual Kanji symbols
as such (rather than treating a 16-bit Kanji symbol as a pair of 8-bit
"characters", as, for instance, the C compiler could in most instances).
The best proposals I've seen are the ones from AT&T-IS that propose a
separate "long char" data type for, well, long characters.  If adding a new
data type is distasteful, one could "typedef" "short" into such a data type,
although you might have to engage in some jiggery-pokery to initialize a
"string" of "short"s from a Kanji string.

You can still distinguish between the unit of storage and the datum used to
hold character representations of, say, Kanji; however, you don't have to do
this by saying "char" will hold those representations, but can provide a new
data type for this.
-- 
	Guy Harris
	{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
	guy at sun.com (or guy at sun.arpa)



More information about the Comp.lang.c mailing list