This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: cpplib: Preliminary implementation of UCNs
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Neil Booth <neil at daikokuya dot co dot uk>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 19 Apr 2003 19:55:28 -0700
- Subject: Re: cpplib: Preliminary implementation of UCNs
- References: <20030419235913.GV23814@daikokuya.co.uk>
Neil Booth <neil at daikokuya dot co dot uk> writes:
> UCNs are presently stored in cpplib in the form they appear in the
> source file. This is because it's easy for -E output, and I'm not sure
> what we want to do as far as mangling is concerned, and I don't think
> it's a good idea to make \u00aa and \u00AA the same identifier, never
> mind making it the same as the character itself. I can't find anything
> in the standard that requires making them the same. Comeau doesn't make
> them the same from what I can see.
I'm not quite sure what you mean by "the same" here.
Certainly, the following is a valid translation unit (assuming you get
the character sets right, the character after the '+' is supposed to
be an accented capital A):
int \u00c0;
int foo(void) { return \u00C0 + À; }
because a UCN only "designates" a character, and identifiers are the
same if they are composed of the same characters.
However, if someone does:
#define STRING(x) #x
printf ("%s %s %s", STRING(\u00c0), STRING(\u00C0), STRING(À));
then by 6.10.3.2 paragraph 2, that should print
\u00c0 \u00C0 À
so some tracking is needed inside cpplib.
--
- Geoffrey Keating <geoffk at geoffk dot org>