[RFC][Fortran,patch] %C error diagnostic location

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

[RFC][Fortran,patch] %C error diagnostic location

Tobias Burnus
Hi all,

my feeling is that %C locations are always off by one, e.g., showing the
(1) under the last white-space character before the place where the
error occurred – the match starts at the character after the
gfc_current_location.

That bothered my for a while – but today, I was wondering whether one
shouldn't simply bump the %C location by one – such that it shows at the
first wrong character and not at the last okay character.

What do you think?


Another observation (unfixed): If gfortran buffers the error, the %C
does not seem to get resolved at gfc_{error,warning} time but at the
time when the buffer is flushed – which will have a reset error location.

Cheers,

Tobias


error.diff (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [RFC][Fortran,patch] %C error diagnostic location

Steve Kargl
On Wed, Oct 02, 2019 at 11:26:17AM +0200, Tobias Burnus wrote:

> Hi all,
>
> I looked at error messages – and I like it. – Please review.
>
> There is actually a "fallout": One testsuite case actually checks for
> the row location – I didn't even know that one can do it that way.
>
> That's fixed by the attached patch (I also included the original patch).
> OK for the trunk?
>

Looks good.

--
Steve