This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Support for %d$c format specifier in diagnostics.c
Ishikawa <ishikawa@yk.rim.or.jp> writes:
>> Tracing through diagnostic.c can be confusing. There is a convention
>> that may help: A function with an argument 'const char *msgid' has
>> responsibility for getting the string translated. This may happen
>> either by a direct call to gettext (which may be written using a
>> shorthand macro: _(msgid)), or by passing the string to another
>> function which will take responsibility.
>>
>> In diagnostic.c, the buck stops (mostly) with diagnostic_set_info.
>>
>> Another convention which is much less widely used: a function with
>> an argument 'const char *msgstr' expects to receive a string that
>> has already been translated.
>>
>> More generally, string variables named 'msgid' are intended to be
>> translated, but haven't yet, and string variables named 'msgstr' have
>> already been translated.
>
> Thank you for the clarification.
> I must have missed this info (written somewhere?).
It is not explicitly stated, but can be deduced from the paragraph of
ABOUT-GCC-NLS following the one you quoted:
By convention, any function parameter in the GCC sources whose name
ends in `msgid' is expected to be a message requiring translation.
For example, the `error' function's first parameter is named
`msgid'. GCC's exgettext script uses this convention to determine
which function parameter strings need to be translated.
It should be more clearly documented. I might even get to clarifying
the documentation eventually.
zw