This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix wchar_t constant strings (take 2)
- To: Jakub Jelinek <jakub at redhat dot com>
- Subject: Re: [PATCH] Fix wchar_t constant strings (take 2)
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Tue, 12 Sep 2000 09:38:02 -0600
- cc: Zack Weinberg <zack at wolery dot cumb dot org>, Andreas Jaeger <aj at suse dot de>, Ulrich Drepper <drepper at cygnus dot com>, gcc-patches at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
In message <20000912071157.B30361@devserv.devel.redhat.com>you write:
> Hi!
>
> lex_string should actually use charwidth, not width to compute bytemask, so
> although my last patch did fix it, it was wrong.
> This is what used to be in c-lex.c before Zack's lex_string creation, thoug
> h
> I'm not sure whether wide characters work at all on BITS_PER_UNIT > 8 (but
> it would not work before either).
> This patch also contains a fix so that
> const wchar_t x[] = L"foo";
>
> x[2] is not "optimized" into (wchar_t)((char *)x)[2].
> All similar code in expand_expr only optimizes non-wide strings this way, i
> t
> should not be hard to handle wchar_t references, but I'm not sure it is
> worth it.
>
> 2000-09-12 Jakub Jelinek <jakub@redhat.com>
>
> * c-lex.c (lex_string): Use charwidth to compute bytemask.
> * expr.c (expand_expr): Don't optimize constant array references
> initialized with wide string constants.
Approved. Please install.
Thanks,
jeff