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] PR19262 more than thirty-nine continuation lines should issue a std-warn

Tobias Burnus wrote:
Jerry DeLisle wrote
The attach patch modifies scanner.c to keep track of the number of
continuation lines in a statement.  The F95 standard says the
number shall not exceed 39. F2003 changes this to 255.  I have set the
limit to default to 255.  If -pedantic is given, it is set to 39.  If
the limit is exceeded an error is issued.

I chose an error rather than warn because the standard states "shall
not".  If others feel strongly that should be a warn, I can easily change.

How about: * default and -std=f2003: 255 (free form) * -std=f90 and -std=f95: 39 (free form) * -std=f2003: 255 (fixed form) * -std=f77, -std=f90, -std=f95: 19 (fixed form) * default (fixed form): 19 ?

I don't see what it has to do with -pedantic.

If you go for an error (and maybe also otherwise), could you add an
option like -maxcontin=N. At least for fixed-form code one easily
exceeds the 19 lines, even if one wants to compile with the -std=* option.


Going into this patch I took the view that gfortran is primarily a Fortran 95 compiler with F2003 features. So I thought the default behavior should be the least restrictive of the two with 255 for free form.

I had not thought about fixed form checks, so I will add that.

The -pedantic is used to signify the more restrictive case. I will adjust that so that the limits of 39 and 19 are used for "-pedantic -std=f95" meaning the user does not want to use the F2003 limits.

Gfortran does not have -std=f77 or -std=f90 as options. Error checking is more or less lumped into legacy, gnu, f95, or f2003.

Regardless, I will try to take into account the numerous comments on this thread.


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