Commit dfbfb630 by Jerry DeLisle

re PR fortran/35882 (Miscounted continuation lines when interspersed with data)

2008-04-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
	    Tobias Burnus  <burnus@net-b.de>

	PR fortran/35882
	* options.c (gfc_init_options): Set the default maximum continuation
	lines to 255 for both free and fixed form source for warnings.
	(gfc_handle_option): Set -std=f95 fixed form max continuations to 19 and
	the -std=f95 free form max continuations to 39 for warnings.
	* scanner.c (gfc_next_char_literal): Adjust the current_line number only
	if it is less than the current locus.

Co-Authored-By: Tobias Burnus <burnus@net-b.de>

From-SVN: r134251
parent e7d95f6f
2008-04-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
PR fortran/35882
* options.c (gfc_init_options): Set the default maximum continuation
lines to 255 for both free and fixed form source for warnings.
(gfc_handle_option): Set -std=f95 fixed form max continuations to 19 and
the -std=f95 free form max continuations to 39 for warnings.
* scanner.c (gfc_next_char_literal): Adjust the current_line number only
if it is less than the current locus.
2008-04-07 Jerry DeLisle <jvdelisle@gcc.gnu.org> 2008-04-07 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/25829 28655 PR fortran/25829 28655
......
...@@ -58,8 +58,8 @@ gfc_init_options (unsigned int argc ATTRIBUTE_UNUSED, ...@@ -58,8 +58,8 @@ gfc_init_options (unsigned int argc ATTRIBUTE_UNUSED,
gfc_option.source_form = FORM_UNKNOWN; gfc_option.source_form = FORM_UNKNOWN;
gfc_option.fixed_line_length = 72; gfc_option.fixed_line_length = 72;
gfc_option.free_line_length = 132; gfc_option.free_line_length = 132;
gfc_option.max_continue_fixed = 19; gfc_option.max_continue_fixed = 255;
gfc_option.max_continue_free = 39; gfc_option.max_continue_free = 255;
gfc_option.max_identifier_length = GFC_MAX_SYMBOL_LEN; gfc_option.max_identifier_length = GFC_MAX_SYMBOL_LEN;
gfc_option.max_subrecord_length = 0; gfc_option.max_subrecord_length = 0;
gfc_option.convert = GFC_CONVERT_NATIVE; gfc_option.convert = GFC_CONVERT_NATIVE;
...@@ -733,6 +733,8 @@ gfc_handle_option (size_t scode, const char *arg, int value) ...@@ -733,6 +733,8 @@ gfc_handle_option (size_t scode, const char *arg, int value)
case OPT_std_f95: case OPT_std_f95:
gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F95 | GFC_STD_F77; gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F95 | GFC_STD_F77;
gfc_option.warn_std = GFC_STD_F95_OBS; gfc_option.warn_std = GFC_STD_F95_OBS;
gfc_option.max_continue_fixed = 19;
gfc_option.max_continue_free = 39;
gfc_option.max_identifier_length = 31; gfc_option.max_identifier_length = 31;
gfc_option.warn_ampersand = 1; gfc_option.warn_ampersand = 1;
gfc_option.warn_tabs = 0; gfc_option.warn_tabs = 0;
...@@ -742,8 +744,6 @@ gfc_handle_option (size_t scode, const char *arg, int value) ...@@ -742,8 +744,6 @@ gfc_handle_option (size_t scode, const char *arg, int value)
gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F77 gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F77
| GFC_STD_F2003 | GFC_STD_F95; | GFC_STD_F2003 | GFC_STD_F95;
gfc_option.warn_std = GFC_STD_F95_OBS; gfc_option.warn_std = GFC_STD_F95_OBS;
gfc_option.max_continue_fixed = 255;
gfc_option.max_continue_free = 255;
gfc_option.max_identifier_length = 63; gfc_option.max_identifier_length = 63;
gfc_option.warn_ampersand = 1; gfc_option.warn_ampersand = 1;
gfc_option.warn_tabs = 0; gfc_option.warn_tabs = 0;
...@@ -753,8 +753,6 @@ gfc_handle_option (size_t scode, const char *arg, int value) ...@@ -753,8 +753,6 @@ gfc_handle_option (size_t scode, const char *arg, int value)
gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F77 gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F77
| GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F2008; | GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F2008;
gfc_option.warn_std = GFC_STD_F95_OBS; gfc_option.warn_std = GFC_STD_F95_OBS;
gfc_option.max_continue_fixed = 255;
gfc_option.max_continue_free = 255;
gfc_option.max_identifier_length = 63; gfc_option.max_identifier_length = 63;
gfc_option.warn_ampersand = 1; gfc_option.warn_ampersand = 1;
gfc_option.warn_tabs = 0; gfc_option.warn_tabs = 0;
......
...@@ -821,7 +821,8 @@ restart: ...@@ -821,7 +821,8 @@ restart:
"statement at %C", gfc_option.max_continue_free); "statement at %C", gfc_option.max_continue_free);
} }
} }
continue_line = gfc_linebuf_linenum (gfc_current_locus.lb); if (continue_line < gfc_linebuf_linenum (gfc_current_locus.lb))
continue_line = gfc_linebuf_linenum (gfc_current_locus.lb);
/* Now find where it continues. First eat any comment lines. */ /* Now find where it continues. First eat any comment lines. */
openmp_cond_flag = skip_free_comments (); openmp_cond_flag = skip_free_comments ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment