Re: Should I laugh or cry?

From: Doug Schiffer (
Date: Thu Dec 19 1996 - 00:19:57 EST

unicode@Unicode.ORG wrote:
[much snipped]

> The wchar_t is an opaque data type (some says semi-opaque) that you
> shouldn't assume on its representation. You can find various
> UNIX spec and std sources saying that it is an opaque data type, for
> instance, XPG4/4.2/5 that subsumes POSIX.1, ANSI C/ISO C, SVID3 and >System V
> ABI, ... The only things that you can be sure (if the OS you are >dealing with
> is XPG4-complient) with the wchar_t type is, there will 0 and PCS >characters
> (with same value that you can assign) exist in the wchar_t in terms of
> code values of the type.

To my knowledge, there isn't a single data type in C that is nailed
down to a specific number of bits. Everything can change, based
on the author of the compiler and capability of the target processor.

You're only granted that long is at least as large as int, for
example. And, I remember my first compiler that 'supported' wchar_t
had sizeof (wchar_t) == 1!!! [MSVC 1.52??]

Hence, if you really want a fixed number of bits, you're best using
macros like UBYTE, UWORD, WORD, LWORD, etc, then having conditionals
to make sure your compiler assigns the correct data type to these.

I like the idea of a macro/typedef called 'unichar', or UNICHAR.
Then we can have UCS4CHAR too! :-)

This archive was generated by hypermail 2.1.2 : Tue Jul 10 2001 - 17:20:33 EDT