This is the mail archive of the gcc-patches@gcc.gnu.org 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


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 3.3.1.4 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.)
> 
> Regards
> 
> Jerry
> 
> 2006-09-22  Jerry DeLisle  <jvdelisle@gcc.gnu.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 3.3.1.4, "A free form statement shall not have
> more than 39
> +      continuation lines."  F2003 standard 3.3.1.4, "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).

Thanks,
Andrew Pinski


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