[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: the wchar_t type



Markus Kuhn writes:

> UCS is just a 31-bit character set after all, so a signed 32-bit int
> (that is what glibc's wchar_t is) will more then do.

Yes, a signed 32-bit int will do. But gcc's `wchar_t' type is actually
`long int', which means:

  - On 64-bit platforms, it is 64-bit. If you use wchar_t arrays, this
    means 50% waste.
  - Even on 32-bit platforms, it causes code like
          printf("0x%04x", wc);
    to emit a warning.

So I'd like to submit patches to the GCC maintainers to change the
definition of `wchar_t' from `long int' to `int'. Any objections?

            Bruno
-
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/lists/