Re: Patch I have Formatted in Git

2017-09-29 Thread nick


On 2017-09-29 04:25 PM, Joseph Myers wrote:
> On Fri, 29 Sep 2017, nick wrote:
> 
>> -  error_at (EXPR_LOCATION (call_expr), "cannot tail-call: %s", reason);
>> +  error_at (EXPR_LOCATION (call_expr), "cannot tail-call: %s", N_(reason));
> 
> This can't be right.  N_ only makes sense around a string literal (e.g. in 
> a constant initializer); it marks a string for extraction for translation, 
> but does not cause it to be translated at runtime.  You need _() to cause 
> the translation at runtime (and then make sure that every string constant 
> that can end up as a value of reason is surrounded by N_() - or just 
> surround the string constants directly by _() if there isn't a reason that 
> won't work).
> 
Exactly what was commented on my another developer I agree should be _(reason) 
as this will need to be used at runtime. I am just building and running
the tests for it now.

Thanks,
Nick


Re: Patch I have Formatted in Git

2017-09-29 Thread Joseph Myers
On Fri, 29 Sep 2017, nick wrote:

> -  error_at (EXPR_LOCATION (call_expr), "cannot tail-call: %s", reason);
> +  error_at (EXPR_LOCATION (call_expr), "cannot tail-call: %s", N_(reason));

This can't be right.  N_ only makes sense around a string literal (e.g. in 
a constant initializer); it marks a string for extraction for translation, 
but does not cause it to be translated at runtime.  You need _() to cause 
the translation at runtime (and then make sure that every string constant 
that can end up as a value of reason is surrounded by N_() - or just 
surround the string constants directly by _() if there isn't a reason that 
won't work).

-- 
Joseph S. Myers
jos...@codesourcery.com


Patch I have Formatted in Git

2017-09-29 Thread nick
Greetings All,
I have this patch formatted in git, I was unable to figure out how the whole 
svn works. I
am new to svn. Here is the patch below so any comments on this patch or how to 
format it
properly would be great:
>From a86173b1cab13a8fe5615c53005adcfafb97415f Mon Sep 17 00:00:00 2001
From: Nicholas Krause <xerofo...@gmail.com>
Date: Fri, 29 Sep 2017 11:39:46 -0400
Subject: [PATCH] Fix maybe_complain_about_tail_call_arises
 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_ marco to translate to the proper lanuage of the user. 
 No new testcases are required due to the triviality of the bug.

Signed-off-by: Nicholas Krause <xerofo...@gmail.com>
---
 gcc/calls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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
-- 
2.11.0