aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/scanner.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenth@gcc.gnu.org>2005-04-17 11:56:30 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2005-04-17 11:56:30 +0000
commita34938bea3d8eeb9bc673b39e6c140825e1cbecf (patch)
treef926b91f8476f6f75b7f2f5760cd828b24508fac /gcc/fortran/scanner.c
parent492f761a97ed76030567349ea2a0ad73c819a9f5 (diff)
downloadgcc-a34938bea3d8eeb9bc673b39e6c140825e1cbecf.zip
gcc-a34938bea3d8eeb9bc673b39e6c140825e1cbecf.tar.gz
gcc-a34938bea3d8eeb9bc673b39e6c140825e1cbecf.tar.bz2
scanner.c (gfc_next_char_literal): Reset truncation flag for lines ending in a comment for both fixed and free form.
2005-04-17 Richard Guenther <rguenth@gcc.gnu.org> * scanner.c (gfc_next_char_literal): Reset truncation flag for lines ending in a comment for both fixed and free form. (load_line): Do not set truncated flag if only truncating the EOL marker. * gfortran.dg/wtruncate.f: New testcase. * gfortran.dg/wtruncate.f90: New testcase. From-SVN: r98269
Diffstat (limited to 'gcc/fortran/scanner.c')
-rw-r--r--gcc/fortran/scanner.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
index 5748ef3..69fa3a1 100644
--- a/gcc/fortran/scanner.c
+++ b/gcc/fortran/scanner.c
@@ -458,6 +458,9 @@ restart:
}
while (c != '\n');
+ /* Avoid truncation warnings for comment ending lines. */
+ gfc_current_locus.lb->truncated = 0;
+
goto done;
}
@@ -525,6 +528,9 @@ restart:
c = next_char ();
}
while (c != '\n');
+
+ /* Avoid truncation warnings for comment ending lines. */
+ gfc_current_locus.lb->truncated = 0;
}
if (c != '\n')
@@ -758,13 +764,13 @@ load_line (FILE * input, char **pbuf)
else if (i >= buflen)
{
/* Truncate the rest of the line. */
- trunc_flag = 1;
-
for (;;)
{
c = fgetc (input);
if (c == '\n' || c == EOF)
break;
+
+ trunc_flag = 1;
}
ungetc ('\n', input);