This is the mail archive of the
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.email@example.com>
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] &
The error is:
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!
> 2010-07-24 Jerry DeLisle <firstname.lastname@example.org>
> PR fortran/42852
> * scanner.c (gfc_next_char_literal): Move check for truncation
> 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.