This is the mail archive of the
mailing list for the GCC project.
Re: [Patch, fortran] PR19262 more than thirty-nine continuation lines should issue a std-warn
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: Jerry DeLisle <jvdelisle at verizon dot net>
- Cc: Fortran List <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 22 Sep 2006 23:21:32 -0700
- Subject: Re: [Patch, fortran] PR19262 more than thirty-nine continuation lines should issue a std-warn
- References: <4514D181.email@example.com>
On Fri, 2006-09-22 at 23:17 -0700, Jerry DeLisle wrote:
> :ADDPATCH fortran:
> The attach patch modifies scanner.c to keep track of the number of continuation
> lines in a statement. The F95 standard 22.214.171.124 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.
> Regression tested. OK for trunk?
> (The attached patch includes the patch for pr19260 since it is in the same
> function. I can commit them together.)
> 2006-09-22 Jerry DeLisle <firstname.lastname@example.org>
> PR fortran/19262
> * scanner.c (gfc_scanner_init_1): Initialize continuation line count
> and set the line count limit.
> (gfc_next_char_literal): Count the number of continuation lines in the
> current statement and error if limit is exceeded.
> + continue_count = 0;
> + continue_line = 0;
> + /* F95 standard 126.96.36.199, "A free form statement shall not have
> more than 39
> + continuation lines." F2003 standard 188.8.131.52, "A free form
> statement shall
> + not have more than 255 continuation lines." Default to 255.
> + if (pedantic)
> + continue_max = 39;
> + else
> + continue_max = 255;
Shouldn't this be checking also -std=f2003 because it seems -pedantic
-std=f2003 right now will give the wrong result.
Maybe even adding a testcase for the 255 limit also (yes it is a long
one but it seems like a good idea).