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: String constant concatenation in c-lex.c


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


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