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]
Other format: [Raw text]

Re: UCNs in identifiers



On 11/03/2005, at 9:45 PM, Neil Booth wrote:


Geoffrey Keating wrote:-

Neil Booth <neil@daikokuya.co.uk> writes:

Geoffrey Keating wrote:-

+		cpp_error (pfile, CPP_DL_ERROR,
+			   "stringizing identifier containing UCN "
+			   "is supported only in C++");

What's your justification for this diagnostic?

As I said in the description of the patch,

Uh, you just said you don't support it in C99. But the requirements of C99 and C++ are identical.

You are right! For some reason, I thought that C99 required the exact same spelling, so that \u00aA gets turned into "\\u00aA", but it actually says


Otherwise, the original spelling of each preprocessing token in the argument is retained in the character string literal, except for special handling for producing the spelling of string literals and character constants: a \ character is inserted before each " and \ character of a character constant or string literal (including the delimiting " characters), except that it is implementation-defined whether a \ character is inserted before the \ character beginning a universal character name.

So #\u00AA gets turned into "\u00AA".


Easily fixed...

Attachment: smime.p7s
Description: S/MIME cryptographic signature


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