This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, Fortran] Show better error location
- From: Mikael Morin <mikael dot morin at sfr dot fr>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: gcc patches <gcc-patches at gcc dot gnu dot org>, gfortran <fortran at gcc dot gnu dot org>
- Date: Sat, 01 Jun 2013 16:06:42 +0200
- Subject: Re: [Patch, Fortran] Show better error location
- References: <51A9EE63 dot 9020904 at net-b dot de>
On 01.06.2013 14:51, Tobias Burnus wrote:
> I am still not happy with changing the length of the displayed
> source-code in error messages to infinity if not terminal is available.
> One reason is that for long lines (e.g. generated code or long trailing
> comment lines) - the output is not very readable. And that the terminal
> is not available happens quite often, e.g. if one uses pipes to "less"
> or "tee" - or redirects to a file.
For the redirection to "less", one can use "less -S".
For "tee", it depends on what comes behind.
For the file case, one doesn't know how wide the final display will be.
It is easy to trim afterwards, but the converse is not true (obviously),
so my point is: keep everything if we don't know how much should be removed.
Would you be more pleased if the checks were reversed, that is first get
the terminal width, then if it fails check if we are outputting to a tty
and if not don't limit the output?
> * * *
>
> I think that one reason for the wish to extend the displayed lines lies
> elsewhere: gfortran sometimes does a bad job with the column location in
> error messages. That's especially visible in the test suite which uses
> long dg-error/dg-warning comments after the actual code.
>
> Thus, I think we should fix the bad column location. (That's beneficial,
> independent whether one increased the trim length or not.)
Certainly
>
> Build and regtested on x86-64-gnu-linux.
> OK for the trunk?
>
OK, thanks.
Mikael