This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: libstdc++ v3 wants more libio functions now
Michael Vance <briareos@lokigames.com> writes:
> On Tue, Jul 25, 2000 at 11:39:32AM -0700, Mike Stump wrote:
>
> > It is a reserved word (in C++), that makes it owned by gcc, no? :-)
>
> Is wchar_t still defined as a four-byte quantity in GCC?
It varies between platforms; GCC generally defines wchar_t to be what
the library is expecting. For instance, on AIX wchar_t is 16 bits,
but under linux it's 32 bits. On some embedded platforms it's 8 bits.
> If so, is there a document or archived mlist discussion somewhere
> documenting why this is?
For proprietary OSs you probably have to ask the authors, many of whom
will say things like "we did this before ISO 10646 became a standard
and can't easily change it".
>I know that the spec says it is
> "implementation-dependent", but every implementation I'm aware of does
> it as a 2-byte wide character. This was a nasty PITA when porting some
> SDK code during Solder of Fortune... does GCC support some locale that
> demands four-byte wide characters?
You probably want to read ISO 10646. It's the ISO standard version of
Unicode.
If ISO 10646 ever adds characters outside the first 65536 code points,
which they are planning to do, it wouldn't be possible to represent
them in a 16-bit wchar_t as single characters. This makes many
operations using these characters much harder. For instance, they
probably couldn't be used as digits, or as whitespace.
--
- Geoffrey Keating <geoffk@cygnus.com>