This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Implementing Universal Character Names in identifiers
- From: Neil Booth <neil at daikokuya dot co dot uk>
- To: "Martin v. L?wis" <loewis at informatik dot hu-berlin dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 7 Nov 2002 09:11:50 +0000
- Subject: Re: Implementing Universal Character Names in identifiers
- References: <200210280715.g9S7FdI2003815@paros.informatik.hu-berlin.de> <20021107080904.GE11859@daikokuya.co.uk> <j4adkl3ga3.fsf@informatik.hu-berlin.de>
Martin v. L?wis wrote:-
> > It would be nice if you could handle escaped newline issues in
> > the UCS; I don't think your patch does that.
>
> You mean, like
>
> \u00\
> c0
>
> ? This is undefined behaviour, in 2.1/1.2, and I think it should be an
> error. It is an error indeed in my patch; the compiler reports
>
> non-hex digit '\' in universal-character-name
We should definitely accept it. Why should UCNs be different from
everything else? I can see that C++ calls it undefined behaviour, but
C99 appears to require it. It's also important, to me at least, from
a QOI perspective.
> > Also, as a QOI issue I'd like token pasting to work for UCS's,
> > though the standard does not require it. Does your patch handle
> > that?
>
> You mean, like
>
> #define Foo(x,y) x##y
>
> void Foo(bar\u00, c0){}
>
> I think this *must* be an error; it's not an option to accept it,
> since bar\u00 is not a token.
A backslash is a token; so is u00c0. Your example is indeed an
error, but was not what I had in mind. I suspect pasting just works,
anyway.
Neil.