public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Patch that fix PR80188
@ 2017-09-29 17:31 nick
  0 siblings, 0 replies; 4+ messages in thread
From: nick @ 2017-09-29 17:31 UTC (permalink / raw)
  To: gcc-patches

Greetings,

I don't have write access so can someone commit this bug fix as it fixes,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80188. 

Author: Nicholas Krause <xerofoify@gmail.com>
Date:   Fri Sep 29 11:39:46 2017 -0400

    This patch fixes, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80188
    which reports that the char* pointer reason is not being translated
    properly when the error message from the function,
    maybe_complain_about_tail_call arises. Fix it by wrapping it in the
    N_ macro to translate to the proper language of the user. No new
    test cases are required due to the triviality of the bug.

diff --git a/gcc/calls.c b/gcc/calls.c
index 6bd025ed197..cfdd6b2cf6b 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -1516,7 +1516,7 @@ maybe_complain_about_tail_call (tree call_expr, const char *reason)
   if (!CALL_EXPR_MUST_TAIL_CALL (call_expr))
     return;
 
-  error_at (EXPR_LOCATION (call_expr), "cannot tail-call: %s", reason);
+  error_at (EXPR_LOCATION (call_expr), "cannot tail-call: %s", N_(reason));
 }
 
 /* Fill in ARGS_SIZE and ARGS array based on the parameters found in

Thanks,

Nick 

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: Patch that fix PR80188
@ 2017-09-29 17:48 Bernd Edlinger
  2017-09-29 18:22 ` nick
  0 siblings, 1 reply; 4+ messages in thread
From: Bernd Edlinger @ 2017-09-29 17:48 UTC (permalink / raw)
  To: nick; +Cc: gcc-patches

 > Greetings,
 >
 > I don't have write access so can someone commit this bug fix as it
 > fixes,
 > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80188.
 >
 > Author: Nicholas Krause <xerofoify@gmail.com>
 > Date:   Fri Sep 29 11:39:46 2017 -0400
 >
 >    This patch fixes, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80188
 >    which reports that the char* pointer reason is not being translated
 >    properly when the error message from the function,
 >    maybe_complain_about_tail_call arises. Fix it by wrapping it in the
 >    N_ macro to translate to the proper language of the user. No new
 >    test cases are required due to the triviality of the bug.
 >
 > diff --git a/gcc/calls.c b/gcc/calls.c
 > index 6bd025ed197..cfdd6b2cf6b 100644
 > --- a/gcc/calls.c
 > +++ b/gcc/calls.c
 > @@ -1516,7 +1516,7 @@ maybe_complain_about_tail_call (tree call_expr, 
const char *reason)
 >    if (!CALL_EXPR_MUST_TAIL_CALL (call_expr))
 >      return;
 >
 > -  error_at (EXPR_LOCATION (call_expr), "cannot tail-call: %s", reason);
 > +  error_at (EXPR_LOCATION (call_expr), "cannot tail-call: %s", 
N_(reason));
 > }
 >
 > /* Fill in ARGS_SIZE and ARGS array based on the parameters found in
 >
 > Thanks,
 >
 > Nick

No, this does obviously not fix the problem.

The main problem is that po/gcc.pot does contain the "cannot tail-call"
string but not the various reasons for it, so the translators have
noting to translate.

You should wrap all strings that need to be translated in N_,
and where you do use N_ you should use _(reason).
So that make -C gcc gcc.pot picks them up when the gcc.pot is created,
which is only done on request, but it would be good to check
that the gcc.pot file looks right with your patch at least.

But most importantly a patch like this is worthless when it was not
tested, so the minimum is you have to state that you did bootstrap with
your patch and the test suite did not produce any new failures
that were not there without your patch.


Bernd.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-29 19:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-29 17:31 Patch that fix PR80188 nick
2017-09-29 17:48 Bernd Edlinger
2017-09-29 18:22 ` nick
2017-09-29 19:50   ` Bernd Edlinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).