Bug 80188 - calls.c: reason argument to maybe_complain_about_tail_call must be marked for translation
Summary: calls.c: reason argument to maybe_complain_about_tail_call must be marked for...
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: translation (show other bugs)
Version: 7.0
: P3 trivial
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL: https://gcc.gnu.org/ml/gcc-patches/20...
Keywords: diagnostic, easyhack, patch
Depends on:
Blocks: 40883
  Show dependency treegraph
 
Reported: 2017-03-25 22:46 UTC by Roland Illig
Modified: 2021-09-12 08:54 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2017-09-29 00:00:00


Attachments
Proposed Fix Send to the GCC-Patches List (689 bytes, patch)
2017-10-15 17:00 UTC, Nicholas Krause
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roland Illig 2017-03-25 22:46:35 UTC
from calls.c:

static void
maybe_complain_about_tail_call (tree call_expr, const char *reason)
{
  ...
  error_at (EXPR_LOCATION (call_expr), "cannot tail-call: %s", reason);
}

The "reason" argument must be marked for translation using N_("..."), but is not. For example:

    maybe_complain_about_tail_call (exp,
      "a callee-copied argument is"
      " stored in the current "
      " function's frame");

This means that the string "a callee-copied ..." is always given in English, even if the rest of the diagnostic is given in German or some other language.

I don't know how to reproduce this particular diagnostic, but there should be a test for it. When running this test in a non-English locale, the diagnostic with mixed language will show up.
Comment 1 Eric Gallager 2017-09-29 00:16:57 UTC
Confirmed that calls.c still contains the code in question.
Comment 2 Nicholas Krause 2017-10-02 14:38:00 UTC
I am working on this but the tester was breaking for me.
Comment 3 Nicholas Krause 2017-10-15 17:00:41 UTC
Created attachment 42372 [details]
Proposed Fix Send to the GCC-Patches List
Comment 4 Eric Gallager 2018-01-17 07:15:28 UTC
(In reply to nik from comment #3)
> Created attachment 42372 [details]
> Proposed Fix Send to the GCC-Patches List

Link to the mailing list archives showing where/when this was sent to gcc-patches?
Comment 5 Nicholas Krause 2018-01-19 06:04:49 UTC
On 2018-01-17 02:15 AM, egallager at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80188
> 
> --- Comment #4 from Eric Gallager <egallager at gcc dot gnu.org> ---
> (In reply to nik from comment #3)
>> Created attachment 42372 [details]
>> Proposed Fix Send to the GCC-Patches List
> 
> Link to the mailing list archives showing where/when this was sent to
> gcc-patches?
> 
https://gcc.gnu.org/ml/gcc-patches/2017-10/msg00420.html

Is a link to the email if you want one.

Sorry for the late follow up,

Nick
Comment 6 Eric Gallager 2018-01-19 07:39:20 UTC
(In reply to nik from comment #5)
> On 2018-01-17 02:15 AM, egallager at gcc dot gnu.org wrote:
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80188
> > 
> > --- Comment #4 from Eric Gallager <egallager at gcc dot gnu.org> ---
> > (In reply to nik from comment #3)
> >> Created attachment 42372 [details]
> >> Proposed Fix Send to the GCC-Patches List
> > 
> > Link to the mailing list archives showing where/when this was sent to
> > gcc-patches?
> > 
> https://gcc.gnu.org/ml/gcc-patches/2017-10/msg00420.html
> 
> Is a link to the email if you want one.
> 
> Sorry for the late follow up,
> 
> Nick

Thanks, adding the "patch" keyword