aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/scanner.c
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2009-09-01 03:02:07 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2009-09-01 03:02:07 +0000
commit9cd38d51e8bd13ccb1433cc920dc29b66820bc09 (patch)
tree9936a9bbed77c9807150e93a8b4afbed01f5b47f /gcc/fortran/scanner.c
parent453503d6e6df0d85757837080f0ea2c72369e974 (diff)
downloadgcc-9cd38d51e8bd13ccb1433cc920dc29b66820bc09.zip
gcc-9cd38d51e8bd13ccb1433cc920dc29b66820bc09.tar.gz
gcc-9cd38d51e8bd13ccb1433cc920dc29b66820bc09.tar.bz2
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
Diffstat (limited to 'gcc/fortran/scanner.c')
-rw-r--r--gcc/fortran/scanner.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
index 8cbb3c5..711042d 100644
--- a/gcc/fortran/scanner.c
+++ b/gcc/fortran/scanner.c
@@ -614,7 +614,7 @@ next_char (void)
/* Skip a comment. When we come here the parse pointer is positioned
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. */
static void
@@ -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. */
openmp_cond_flag = skip_free_comments ();
@@ -1158,6 +1169,14 @@ restart:
if (c != '\n')
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;
continue_flag = 1;
old_loc = gfc_current_locus;