This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: wide chars with 16 BITS_PER_UNIT
- From: Thomas Gill <ned at tropic dot org dot uk>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 2 Apr 2007 13:29:22 +0100
- Subject: Re: wide chars with 16 BITS_PER_UNIT
- References: <20070330125912.GA7137@tropic.org.uk> <20070330165222.GA11436@redhat.com>
On Fri, Mar 30, 2007 at 09:52:22AM -0700, Richard Henderson wrote:
> I think the problem is that we've not told libcpp what the correct
> narrow character set is. I suggest adding something like
>
> if (BITS_PER_UNIT >= 32)
> cpp_opts->narrow_charset = BYTES_BIG_ENDIAN ? "UTF-32BE" : "UTF-32LE";
> else if (BITS_PER_UNIT >= 16)
> cpp_opts->narrow_charset = BYTES_BIG_ENDIAN ? "UTF-16BE" : "UTF-16LE";
>
Ah! That seems to do the trick. I'm still getting problems with numeric
escapes, but I notice this comment in emit_numeric_escape:
/* Note: this code does not handle the case where the target
and host have a different number of bits in a byte. */
So my guess is that needs a fix too. I'm also seeing warnings from
character literals like:
warning: character constant too long for its type
I should be able to chase this down too, though.
Thanks for the help,
Ned.