This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch,fortran] PR42852 -Wall warns about truncated lines when only a continuation character is truncated
- From: Tobias Burnus <burnus at net-b dot de>
- To: Jerry DeLisle <jvdelisle at verizon dot net>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 25 Jul 2010 11:23:30 +0200
- Subject: Re: [patch,fortran] PR42852 -Wall warns about truncated lines when only a continuation character is truncated
- References: <4C4BB728.4070707@verizon.net>
Jerry DeLisle wrote:
> This patch provides some enhancement for truncation warnings.
> Fairly self explanatory.
>
> Regression tested on x86-64-linuc-gnu.
> OK for trunk?
Not announced, but I like that with the patch gfortran also does no
longer warn if there are just trailing spaces or a comment ("!") which
starts after column 72.
* * *
However, I do not like how free-form source code is handled: If I have a
long line (>132) of spaces followed by a continuation character, e.g.,
integer :: a [many spaces] &
, b
end
The error is:
, b
1
Error: Invalid character in name at (1)
Expected: Additionally, one should see
Warning: Line truncated at (1)
In case of free form code, the '&' is significant - and it can easily
happen that just the continuation character moves beyond column 132.
* * *
Actually, I just realised that your patch does not change the warning
for free-form code. Thus:
The patch is OK. Thanks!
Tobias
> 2010-07-24 Jerry DeLisle <jvdelisle@gcc.gnu.org>
>
> PR fortran/42852
> * scanner.c (gfc_next_char_literal): Move check for truncation
> earlier
> in the function so that it does not get missed by early exits.
> (load_line): Add checks for quoted strings and free form comments to
> disable warnings on comments. Add check for ampersand as first
> character after truncation and don't warn for this case, but warn if
> there are subsequent non-whitespace characters.