This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH fortran/linemap] Add enough column hint to fit any possible offset
- From: Tobias Burnus <burnus at net-b dot de>
- To: Manuel López-Ibáñez <lopezibanez at gmail dot com>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>, "fortran at gcc dot gnu dot org List" <fortran at gcc dot gnu dot org>, Dodji Seketeli <dodji at redhat dot com>
- Date: Thu, 04 Dec 2014 00:25:00 +0100
- Subject: Re: [PATCH fortran/linemap] Add enough column hint to fit any possible offset
- Authentication-results: sourceware.org; auth=none
- References: <CAESRpQCNKPOsYZRg87nC2zdKtWxVaGbNw-XVC6A7gVzccWzoGQ at mail dot gmail dot com>
Manuel López-Ibáñez wrote:
In any case, the current patch fixes these ICEs and I couldn't trigger
new ones. Bootstrapped and regression tested.
OK for Fortran?
OK. Thanks.
* * *
BTW: The output of the code changes with the common diagnostic. For a
different test case, I get (old)
-------------------------
print *, "rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
", "jgk
1
Warning: Nonconforming tab character at (1)
-------------------------
while the new code gives:
-------------------------
print *, "rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
", "jgkg"
1
Warning: Nonconforming tab character at (1) [-Wtabs]
-------------------------
Namely, the previous code trims the output to show only the code around
the error location while the common-diagnostics code shows the whole line.
(That's normally not observable as the lines are short. That makes the ^
or rather (1) look rather misplaced. On the other hand, if the error
location is misplaced, it is actually better; e.g. if a comment is at
the end like the long "! {dg-error ...}", the location might point at
the end of the comment, which is rather misplaced. Still, only showing
part of the line probably makes sense in general.)
Tobias
gcc/fortran/ChangeLog:
2014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
* scanner.c (gfc_next_char_literal): Use gfc_warning_now.
(load_file): Use the line length as the column hint for
linemap_line_start. Reserve a location for the highest column of
the line.
gcc/testsuite/ChangeLog:
2014-12-02 Manuel López-Ibáñez <manu@gcc.gnu.org>
* gfortran.dg/line_length_5.f90: New test.