This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch,fortran] PR42852 -Wall warns about truncated lines when only a continuation character is truncated

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

The error is:
, b
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  <>
>     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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]