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: Implementing Universal Character Names in identifiers


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.


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