diff mbox series

[committed,Fortran] PR 92072 – fix %C corner case

Message ID 50dd4bc3-6595-35ff-fefa-6baef745ba9c@codesourcery.com
State New
Headers show
Series [committed,Fortran] PR 92072 – fix %C corner case | expand

Commit Message

Tobias Burnus Oct. 14, 2019, 8:34 a.m. UTC
In patch https://gcc.gnu.org/ml/gcc-patches/2019-10/msg00092.html , I 
increased the error column location by one to point to the actual error.

That works fine, except when the character is one before the end of the 
line (= '\0') – as the PR 92072 shows.

This patch checks for this and only increases the location by one if 
that's not the case. Cf. scanner.c's next_char().

Comitted as Rev. 276953 (+ 276955).

Cheers,

Tobias

Comments

Bernhard Reutner-Fischer Oct. 14, 2019, 9:52 a.m. UTC | #1
On 14 October 2019 10:34:37 CEST, Tobias Burnus <tobias@codesourcery.com> wrote:
>In patch https://gcc.gnu.org/ml/gcc-patches/2019-10/msg00092.html , I 
>increased the error column location by one to point to the actual
>error.
>
>That works fine, except when the character is one before the end of the
>
>line (= '\0') – as the PR 92072 shows.
>
>This patch checks for this and only increases the location by one if 
>that's not the case. Cf. scanner.c's next_char().
>
>Comitted as Rev. 276953 (+ 276955).

--- a/gcc/fortran/error.c
+++ b/gcc/fortran/error.c
@@ -1,3 +1,4 @@
+#pragma GCC optimize("O0")
 /* Handle errors.

Debugging leftover.
TIA,
Tobias Burnus Oct. 14, 2019, 9:56 a.m. UTC | #2
Hi Bernard,

On 10/14/19 11:52 AM, Bernhard Reutner-Fischer wrote:
>> Comitted as Rev. 276953 (+ 276955).

The second commit (i.e "+" part)  and the second attached patch (scroll 
to the last line of previous/that email) are there because I saw the 
following myself.

>> +++ b/gcc/fortran/error.c
>> @@ -1,3 +1,4 @@
>> +#pragma GCC optimize("O0")


Cheers,

Tobias
Bernhard Reutner-Fischer Oct. 14, 2019, 10:01 a.m. UTC | #3
On 14 October 2019 11:56:28 CEST, Tobias Burnus <tobias@codesourcery.com> wrote:
>Hi Bernard,
>
>On 10/14/19 11:52 AM, Bernhard Reutner-Fischer wrote:
>>> Comitted as Rev. 276953 (+ 276955).
>
>The second commit (i.e "+" part)  and the second attached patch (scroll
>
>to the last line of previous/that email) are there because I saw the 
>following myself.

Just saw it after hitting send, sorry for that..
Cheers,
diff mbox series

Patch

Index: gcc/fortran/ChangeLog
===================================================================
--- gcc/fortran/ChangeLog	(revision 276953)
+++ gcc/fortran/ChangeLog	(working copy)
@@ -1,5 +1,9 @@ 
 2019-10-14  Tobias Burnus  <tobias@codesourcery.com>
 
+	* error.c: Remove debug pragma added in previous commit.
+
+2019-10-14  Tobias Burnus  <tobias@codesourcery.com>
+
 	PR fortran/92072
 	* error.c (error_print, gfc_format_decoder): Fix %C column-
 	offset handling.
Index: gcc/fortran/error.c
===================================================================
--- gcc/fortran/error.c	(revision 276953)
+++ gcc/fortran/error.c	(working copy)
@@ -1,4 +1,3 @@ 
-#pragma GCC optimize("O0")
 /* Handle errors.
    Copyright (C) 2000-2019 Free Software Foundation, Inc.
    Contributed by Andy Vaught & Niels Kristian Bech Jensen