Re: [PATCH 3/N] Fix GCC internal format in D front-end.

2019-04-03 Thread Martin Liška
On 4/2/19 4:13 PM, Iain Buclaw wrote:
> On Tue, 2 Apr 2019 at 12:51, Martin Liška  wrote:
>>
>> On 3/11/19 3:00 PM, Martin Liška wrote:
>>> On 3/11/19 2:38 PM, Jakub Jelinek wrote:
 I think for D you need to go through Iain Buclaw, I have no idea if
 exp->error even has the gcc internal format infrastructure.  Can you split
 that part of the patch and post it independently?
>>>
>>> The patch addresses that.
>>>
>>> Martin
>>>
>>
>> Iain, what do you think about the patch?
>>
> 
> Is this because it got picked up by exgettext?  I've added
> expressionsem.c to the EXCLUDES so I think this change is no longer
> needed.

Ok then.

Thanks

> 
> If required however, then the place to fix it would be in
> expand_d_format, which deals with oddities with format strings in the
> dmd front-end.
> 



Re: [PATCH 3/N] Fix GCC internal format in D front-end.

2019-04-02 Thread Iain Buclaw
On Tue, 2 Apr 2019 at 12:51, Martin Liška  wrote:
>
> On 3/11/19 3:00 PM, Martin Liška wrote:
> > On 3/11/19 2:38 PM, Jakub Jelinek wrote:
> >> I think for D you need to go through Iain Buclaw, I have no idea if
> >> exp->error even has the gcc internal format infrastructure.  Can you split
> >> that part of the patch and post it independently?
> >
> > The patch addresses that.
> >
> > Martin
> >
>
> Iain, what do you think about the patch?
>

Is this because it got picked up by exgettext?  I've added
expressionsem.c to the EXCLUDES so I think this change is no longer
needed.

If required however, then the place to fix it would be in
expand_d_format, which deals with oddities with format strings in the
dmd front-end.

-- 
Iain


Re: [PATCH 3/N] Fix GCC internal format in D front-end.

2019-04-02 Thread Martin Liška
On 3/11/19 3:00 PM, Martin Liška wrote:
> On 3/11/19 2:38 PM, Jakub Jelinek wrote:
>> I think for D you need to go through Iain Buclaw, I have no idea if
>> exp->error even has the gcc internal format infrastructure.  Can you split
>> that part of the patch and post it independently?
> 
> The patch addresses that.
> 
> Martin
> 

Iain, what do you think about the patch?

Thanks,
Martin


[PATCH 3/N] Fix GCC internal format in D front-end.

2019-03-11 Thread Martin Liška
On 3/11/19 2:38 PM, Jakub Jelinek wrote:
> I think for D you need to go through Iain Buclaw, I have no idea if
> exp->error even has the gcc internal format infrastructure.  Can you split
> that part of the patch and post it independently?

The patch addresses that.

Martin

>From 2285a99c9ca1435346eac9dbc0ffd41d29b8eaec Mon Sep 17 00:00:00 2001
From: marxin 
Date: Mon, 11 Mar 2019 14:59:25 +0100
Subject: [PATCH] Fix GCC internal format in D front-end.

gcc/d/ChangeLog:

2019-03-11  Martin Liska  

	* dmd/expressionsem.c: Fix GCC internal format.
---
 gcc/d/dmd/expressionsem.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gcc/d/dmd/expressionsem.c b/gcc/d/dmd/expressionsem.c
index bcc1ac9ed2f..cf09f097476 100644
--- a/gcc/d/dmd/expressionsem.c
+++ b/gcc/d/dmd/expressionsem.c
@@ -1366,7 +1366,7 @@ public:
 }
 else
 {
-exp->error("new can only create structs, dynamic arrays or class objects, not %s's", exp->type->toChars());
+exp->error("new can only create structs, dynamic arrays or class objects, not %s%'s", exp->type->toChars());
 return setError();
 }
 
@@ -2298,7 +2298,7 @@ public:
 const char *name = (char *)se->string;
 if (!global.params.fileImppath)
 {
-e->error("need -Jpath switch to import text file %s", name);
+e->error("need %<-Jpath%> switch to import text file %s", name);
 return setError();
 }
 
@@ -2310,7 +2310,7 @@ public:
 name = FileName::safeSearchPath(global.filePath, name);
 if (!name)
 {
-e->error("file %s cannot be found or not in a path specified with -J", se->toChars());
+e->error("file %s cannot be found or not in a path specified with %<-J%>", se->toChars());
 return setError();
 }
 
@@ -6444,7 +6444,7 @@ public:
 e = scaleFactor(exp, sc);
 else
 {
-exp->error("can't subtract %s from pointer", t2->toChars());
+exp->error("can%'t subtract %s from pointer", t2->toChars());
 e = new ErrorExp();
 }
 result = e;
@@ -6453,7 +6453,7 @@ public:
 if (t2->ty == Tpointer)
 {
 exp->type = exp->e2->type;
-exp->error("can't subtract pointer from %s", exp->e1->type->toChars());
+exp->error("can%'t subtract pointer from %s", exp->e1->type->toChars());
 return setError();
 }
 
@@ -8702,6 +8702,6 @@ Expression *semanticY(DotTemplateInstanceExp *exp, Scope *sc, int flag)
 return e;
 }
 Lerr:
-e->error("%s isn't a template", e->toChars());
+e->error("%s isn%'t a template", e->toChars());
 return new ErrorExp();
 }
-- 
2.21.0