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

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Tobias Burnus-3
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


patch.diff (2K) Download Attachment
patch2.diff (852 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

Bernhard Reutner-Fischer
On 14 October 2019 10:34:37 CEST, Tobias Burnus <[hidden email]> 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,
Reply | Threaded
Open this post in threaded view
|

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

Bernhard Reutner-Fischer
On 14 October 2019 11:56:28 CEST, Tobias Burnus <[hidden email]> 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,