Patchwork *ping* Re: [PATCH, PR preprocessor/42014] Added LAST_SOURCE_COLUMN in while loop

login
register
mail settings
Submitter Shakthi Kannan
Date May 22, 2013, 6:31 a.m.
Message ID <1679064113.5638738.1369204271480.JavaMail.root@redhat.com>
Download mbox | patch
Permalink /patch/245550/
State New
Headers show

Comments

Shakthi Kannan - May 22, 2013, 6:31 a.m.
Hi,

Is the following patch okay for trunk?

SK

----- Original Message -----
From: "Shakthi Kannan" <skannan@redhat.com>
To: gcc-patches@gcc.gnu.org
Sent: Friday, May 10, 2013 12:25:07 PM
Subject: [PATCH, PR preprocessor/42014] Added LAST_SOURCE_COLUMN in while loop

Hi,

The attached patch adds LAST_SOURCE_COLUMN to pp_verbatim
function in the while loop present in
diagnostic_report_current_module(). This makes the output
consistent for any error parsing program as stated in the bug.

2013-05-10 Shakthi Kannan <skannan@redhat.com>

    PR preprocessor/42014
    * gcc/diagnostic.c: Added LAST_SOURCE_COLUMN in while loop.

---
 gcc/diagnostic.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Tom Tromey - May 22, 2013, 3:23 p.m.
>>>>> "Shakthi" == Shakthi Kannan <skannan@redhat.com> writes:

Shakthi> Is the following patch okay for trunk?

I still think it needs a test case.
I also don't recall -- did you check to see if the column number that is
emitted is actually correct?

You may want to change the Subject line of your note, as well.
The bug is filed against the preprocessor but it would have to be
reviewed by a diagnostics maintainer.

Tom

Patch

diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index f9a236b..2addbf0 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -528,8 +528,9 @@  diagnostic_report_current_module (diagnostic_context *context, location_t where)
 	    {
 	      map = INCLUDED_FROM (line_table, map);
 	      pp_verbatim (context->printer,
-			   ",\n                 from %s:%d",
-			   LINEMAP_FILE (map), LAST_SOURCE_LINE (map));
+			   ",\n                 from %s:%d:%d",
+			   LINEMAP_FILE (map),
+			   LAST_SOURCE_LINE (map), LAST_SOURCE_COLUMN (map));
 	    }
 	  pp_verbatim (context->printer, ":");
 	  pp_newline (context->printer);