[Patch, fortran] PR19262 more than thirty-nine continuation lines should issue a std-warn

Jerry DeLisle jvdelisle@verizon.net
Wed Sep 27 06:35:00 GMT 2006


:REVIEWMAIL:

Here is what I have implemented in response to comments. (see attached patch and 
test cases)

Default warn limits set to fixed form 19, free form 39.
With -std=f2003, fixed form warn limit set to 255, free form warn limit set to 255.

I decided to set the limit thresholds this way after digging out my old Fortran
IV book and low and behold, the limit of 19 continuations. The Fortran 66
standard states 19. The F77 standard states 19. And of course, for free form F95
it is 39. (I do not have an F90 standard)

I am using gfc_notification_std (GFC_STD_GNU) so that a warning is issued if the
  respective limit is exceeded and the user specifies -std=f95 or -std=f2003.

As stated elsewhere in this thread, the requirement for these limits is on
the programmer, not the compiler, so we only warn.

I moved the setting of the limits to options.c where it belongs.

I am also issuing a warning if the respective limit is exceeded when -pedantic
is given, regardless of any -std specified.  This allows at least checking to
see if you are under the respective limit.

Naturally, -w will suppress any warning.

There is no actual limit on the number of continuation lines used.

I did not want to add yet another option to allow explicit setting of the limit
values.  It does not seem necessary.

Regression tested and NIST tested.  Test cases included.

The patch contains the fix for PR19260 as well.

OK for trunk?

2006-09-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/19262
	* options.c (gfc_init_options): Initialize fixed form and free form
	consecutive continuation line limits.
	* scanner.c (gfc_scanner_init_1): Initialize continue_line
	and continue_count. (gfc_next_char_literal): Count the number of
	continuation lines in the current statement and warn if
	limit is exceeded.

2006-09-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/19260
	* scanner.c (gfc_next_char_literal): Add check for missing '&'
	and set locus to old_locus when not scanning a character literal.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr19262b.diff
Type: text/x-patch
Size: 4961 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060927/bf2fb8c2/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: continuation_1.f90
Type: text/x-fortran
Size: 582 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060927/bf2fb8c2/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: continuation_2.f90
Type: text/x-fortran
Size: 190 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060927/bf2fb8c2/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: continuation_3.f90
Type: text/x-fortran
Size: 1922 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060927/bf2fb8c2/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: continuation_4.f90
Type: text/x-fortran
Size: 5671 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060927/bf2fb8c2/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: continuation_5.f
Type: text/x-fortran
Size: 1030 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060927/bf2fb8c2/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: continuation_6.f
Type: text/x-fortran
Size: 5175 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060927/bf2fb8c2/attachment-0006.bin>


More information about the Fortran mailing list