This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix exgettext to handle multi-line help texts from *.opt files (PR translation/78745)
- From: Alexander Monakov <amonakov at ispras dot ru>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Thomas Schwinge <thomas at codesourcery dot com>, gcc-patches at gcc dot gnu dot org, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Thu, 16 Feb 2017 19:08:00 +0300 (MSK)
- Subject: Re: [PATCH] Fix exgettext to handle multi-line help texts from *.opt files (PR translation/78745)
- Authentication-results: sourceware.org; auth=none
- References: <20161229151501.GO21933@tucnak> <87inpofbl6.fsf@euler.schwinge.homeip.net> <87o9y28lyi.fsf@euler.schwinge.homeip.net> <alpine.LNX.2.20.13.1702161342460.13897@monopod.intra.ispras.ru> <20170216114111.GA1849@tucnak>
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?
> 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;" \
Thanks.
Alexander