This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [POC v2 PATCH] __builtin_warning
Joseph Myers <joseph@codesourcery.com> writes:
> On Mon, 14 Oct 2019, Martin Sebor wrote:
>
>> On 10/14/19 4:03 PM, Joseph Myers wrote:
>> > How does this interact with translation?
>> >
>> > My expectation would be that in user code, the message is taken literally
>> > as-is; it is not looked up in the GCC message catalog even if it is
>> > identical to some GCC diagnostic. However, when used internally for GCC
>> > diagnostics, they should be translated, meaning the translation for GCC
>> > diagnostics using this mechanism should occur before the built-in call is
>> > stored in the IR.
>>
>> Right, that would make sense. Does something make you think it will
>> be hard to do?
>
> No. I'd expect the code generating the IR from GCC diagnostics should
> arrange for the message to be translated first (while in the case of
> __builtin_warning in user code, it would not be translated), and the code
> subsequently using the IR to use diagnostic_set_info_translated or
> functions that end up calling it without trying to translate.
Might be a daft question, but would we ever want GCC to introduce new
calls before LTO streaming? I guess we shouldn't assume that the user
who builds the final object will be using the same locale.
Richard