Commit 9cd38d51 by Jerry DeLisle

re PR fortran/39229 (No warning of truncated lines if a continuation line follows)

2009-08-31  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/39229
	* scanner.c (next_char): Fix typo in comment.
	(gfc_get_char_literal): Warn if truncate flag is set for both fixed and
	free form source, adjusting error locus as needed.
	* parse.c (next_fixed): Clear the truncate flag.
	(next_statement): Remove truncate warning.

From-SVN: r151258
parent 453503d6
2009-08-31 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/39229
* scanner.c (next_char): Fix typo in comment.
(gfc_get_char_literal): Warn if truncate flag is set for both fixed and
free form source, adjusting error locus as needed.
* parse.c (next_fixed): Clear the truncate flag.
(next_statement): Remove truncate warning.
2009-08-31 Janus Weil <janus@gcc.gnu.org> 2009-08-31 Janus Weil <janus@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org> Paul Thomas <pault@gcc.gnu.org>
...@@ -96,10 +105,10 @@ ...@@ -96,10 +105,10 @@
(gfc_find_typebound_intrinsic_op): Ditto. (gfc_find_typebound_intrinsic_op): Ditto.
(gfc_find_typebound_proc), (gfc_find_typebound_user_op): New locus arg. (gfc_find_typebound_proc), (gfc_find_typebound_user_op): New locus arg.
2009-08-22 Bud Davis <bdavis9659@sbcglobal.net> 2009-08-22 Bud Davis <bdavis9659@sbcglobal.net>
PR fortran/28093 PR fortran/28093
* io.c: reverted previous patch * io.c: reverted previous patch.
2009-08-25 Janne Blomqvist <jb@gcc.gnu.org> 2009-08-25 Janne Blomqvist <jb@gcc.gnu.org>
...@@ -175,7 +184,7 @@ ...@@ -175,7 +184,7 @@
allocation-object are conformable. allocation-object are conformable.
(gfc_match_allocate): Use new functions. Match SOURCE= tag. (gfc_match_allocate): Use new functions. Match SOURCE= tag.
2009-08-22 Bud Davis <bdavis9659@sbcglobal.net> 2009-08-22 Bud Davis <bdavis9659@sbcglobal.net>
PR fortran/28093 PR fortran/28093
* io.c : added variable to store original len of fmt * io.c : added variable to store original len of fmt
......
...@@ -849,6 +849,8 @@ next_fixed (void) ...@@ -849,6 +849,8 @@ next_fixed (void)
blank_line: blank_line:
if (digit_flag) if (digit_flag)
gfc_warning ("Ignoring statement label in empty statement at %C"); gfc_warning ("Ignoring statement label in empty statement at %C");
gfc_current_locus.lb->truncated = 0;
gfc_advance_line (); gfc_advance_line ();
return ST_NONE; return ST_NONE;
} }
...@@ -862,6 +864,7 @@ next_statement (void) ...@@ -862,6 +864,7 @@ next_statement (void)
{ {
gfc_statement st; gfc_statement st;
locus old_locus; locus old_locus;
gfc_new_block = NULL; gfc_new_block = NULL;
gfc_current_ns->old_cl_list = gfc_current_ns->cl_list; gfc_current_ns->old_cl_list = gfc_current_ns->cl_list;
...@@ -871,14 +874,7 @@ next_statement (void) ...@@ -871,14 +874,7 @@ next_statement (void)
gfc_buffer_error (1); gfc_buffer_error (1);
if (gfc_at_eol ()) if (gfc_at_eol ())
{ gfc_advance_line ();
if ((gfc_option.warn_line_truncation || gfc_current_form == FORM_FREE)
&& gfc_current_locus.lb
&& gfc_current_locus.lb->truncated)
gfc_warning_now ("Line truncated at %C");
gfc_advance_line ();
}
gfc_skip_comments (); gfc_skip_comments ();
......
...@@ -614,7 +614,7 @@ next_char (void) ...@@ -614,7 +614,7 @@ next_char (void)
/* Skip a comment. When we come here the parse pointer is positioned /* Skip a comment. When we come here the parse pointer is positioned
immediately after the comment character. If we ever implement immediately after the comment character. If we ever implement
compiler directives withing comments, here is where we parse the compiler directives within comments, here is where we parse the
directive. */ directive. */
static void static void
...@@ -1080,6 +1080,17 @@ restart: ...@@ -1080,6 +1080,17 @@ restart:
} }
} }
/* Check to see if the continuation line was truncated. */
if (gfc_option.warn_line_truncation && gfc_current_locus.lb != NULL
&& gfc_current_locus.lb->truncated)
{
int maxlen = gfc_option.free_line_length;
gfc_current_locus.lb->truncated = 0;
gfc_current_locus.nextc += maxlen;
gfc_warning_now ("Line truncated at %L", &gfc_current_locus);
gfc_current_locus.nextc -= maxlen;
}
/* 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 ();
...@@ -1158,6 +1169,14 @@ restart: ...@@ -1158,6 +1169,14 @@ restart:
if (c != '\n') if (c != '\n')
goto done; goto done;
/* Check to see if the continuation line was truncated. */
if (gfc_option.warn_line_truncation && gfc_current_locus.lb != NULL
&& gfc_current_locus.lb->truncated)
{
gfc_current_locus.lb->truncated = 0;
gfc_warning_now ("Line truncated at %L", &gfc_current_locus);
}
prev_openmp_flag = openmp_flag; prev_openmp_flag = openmp_flag;
continue_flag = 1; continue_flag = 1;
old_loc = gfc_current_locus; old_loc = gfc_current_locus;
......
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