This is the mail archive of the
mailing list for the GCC project.
Re: gcc/cp/pt.c: use ngettext() when needed
2010/2/17 Gabriel Dos Reis <email@example.com>:
> On Wed, Feb 17, 2010 at 9:23 AM, Marco Poletti <firstname.lastname@example.org> wrote:
>> In the file pt.c, there were translatable strings like "redeclared
>> with %d template parameter(s)" that are hard to translate.
>> Instead, it should use the ngettext() function to allow more flexible
>> I've added two functions inform_translated() and error_translated() to
>> diagnostic.c, that are called by pt.c.
>> This is my second patch to GCC, I could have done something wrong.
>> Critics are very appreciated.
> I'm uncomfortable with adding these two functions.
> It is possible to just call a preprocessor ngettext() first and give the
> result to error() or inform()?
Can you explain better? What do you mean with "preprocessor ngettext()"?
If you mean implementing ngettext() with the preprocessor, it's too
However, you should not pass the ngettext() output to error() or
inform() because they call diagnostic_set_info() that would attempt to
translate the string again.
A similar solution is already used in collect2.c BTW.