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: cpplib: Preliminary implementation of UCNs


> Date: Sun, 20 Apr 2003 13:26:18 +0100 (BST)
> From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>

> On Sun, 19 Apr 2003, Geoff Keating wrote:
> 
> > 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.
> 
> Backslashes outside string and character constants do not get escaped, so 
> this yields (for C)
> 
> printf ("%s %s %s", "\u00c0", "\u00C0", "À");
> 
> which prints
> 
> À À À

Good point; yes, because translation phase 4 is when the # gets
evaluated, and phase 5 is when the \u00c0 gets replaced with `À'.

-- 
- Geoffrey Keating <geoffk at geoffk dot org>


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