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

Tobias Burnus burnus@net-b.de
Wed Oct 2 09:26:00 GMT 2019


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?

Tobias

PS: The effect of the patch can also be seen at the patch description 
at: https://gcc.gnu.org/ml/gcc-patches/2019-10/msg00110.html

On 10/2/19 12:26 AM, Tobias Burnus wrote:
> 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
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: percent-c-error.diff
Type: text/x-patch
Size: 2400 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20191002/f0e6f365/attachment.bin>


More information about the Gcc-patches mailing list