This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: String constant concatenation in c-lex.c
- To: Zack Weinberg <zackw at stanford dot edu>
- Subject: Re: String constant concatenation in c-lex.c
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Date: Thu, 21 Jun 2001 10:46:46 +0100 (BST)
- cc: <gcc-patches at gcc dot gnu dot org>
On Wed, 20 Jun 2001, Zack Weinberg wrote:
> As Joseph suggested last week: this patch does C's string constant
> concatenation inside lex_string, instead of separately in
I didn't suggest this, it's been in projects/cpplib.html for some time.
> Also, a long-standing bug with wide string conversion is fixed. Consider
>
> "abc*def" L"ghijkl"
>
> where the splat is actually a multi-byte character whose wchar_t form
> doesn't fit in a single byte. The C standard says that this is to
> wind up as a wide string, and that the multibyte representations are
> to be concatenated, then the whole megillah converted to wide
> characters at once.
The C standard is somewhat confused on exactly how multibyte-to-wide
conversions of string literals are supposed to work. See e.g. WG14
reflector sequence numbers 8797, 8802, 8811, 8821, 8826. To confuse
things further, C++ differs from C (extended characters in the source get
converted to UCNs in C++).
--
Joseph S. Myers
jsm28@cam.ac.uk