This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] Fix wchar_t constant strings (take 2)



  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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]