On Thu, Feb 16, 2017 at 07:08:00PM +0300, Alexander Monakov wrote:
> On Thu, 16 Feb 2017, Jakub Jelinek wrote:
> > On Thu, Feb 16, 2017 at 01:56:15PM +0300, Alexander Monakov wrote:
> > Are you sure you can't have them in *.c file (e.g. by setting some variable
> > to a spec string or similar)?
> > I think it is better to scan all those files.
> 
> Hm, probably that idea was premature, but I hope you can bear with me a bit 
> more
> here.  It still strikes me as really odd that exgettext works by scanning all
> strings for %e/%n.  Would it be possible to explicitly delimit translatable 
> spec
> messages, by rewriting where we currently have
> 
>   "... %eMessage} ..."
> 
> to
> 
>   #define SPEC_MESSAGE(msg) msg
> 
>   "... %e" SPEC_MESSAGE ("Message") "} ..."
> 
> and then only handling SPEC_MESSAGE specially in exgettext, rather than %e?

We have over 90 of these, plus it would make the specs even harder to read.
Will defer this to Joseph anyway.

> > To avoid triggering this you can e.g. use
> > --- gcc/config/nvptx/nvptx.c.jj     2017-01-01 12:45:43.000000000 +0100
> > +++ gcc/config/nvptx/nvptx.c        2017-02-16 12:31:49.261550375 +0100
> > @@ -1129,7 +1129,7 @@ write_omp_entry (FILE *file, const char
> >     .reg.u32 %r<3>;\n\
> >     .reg.u" PS " %R<4>;\n\
> >     mov.u32 %r0, %tid.y;\n\
> > -   mov.u32 %r1, %ntid.y;\n\
> > +   mov.u32 %r1, %ntid.y;\n""\
> >     mov.u32 %r2, %ctaid.x;\n\
> >     cvt.u" PS ".u32 %R1, %r0;\n\
> >     " MAD_PS_32 " %R1, %r1, %r2, %R1;\n\
> 
> I believe this is preferable as a minimal fix, perhaps with a space between
> added quotes, or even:
> 
> +     mov.u32 %r1, %ntid.y;\n" /* Avoid %n processing in exgettext.  */ "\
> 
> (sorry for the bikeshed)
> 
> > or change the macro so that it doesn't use multi-line string and instead
> > has say:
> > "\n\t"      "mov.u32 %r1, %ntid.y;"
> > "\n\t"      "mov.u32 %r2, %ctaid.x;"
> > etc. style. or even just
> > "   mov.u32 %r1, %ntid.y;\n"
> > "   mov.u32 %r2, %ctaid.x;\n"
> 
> These variants need adding backslash-at-eol for continuing the macro body.  If
> changing the macro is desired, this style can help keep the noise down:
> 
> "\n<tab>mov.u32 %r1, %ntid.y;" \

Sorry for forgetting the final \ .  And no particular preference.

        Jakub

Reply via email to