+2005-04-15 Richard Guenther <rguenth@gcc.gnu.org>
+
+ PR fortran/14569
+ * gfortran.h (gfc_linebuf): Add truncated field.
+ * parse.c (next_statement): Handle warning for truncated
+ lines.
+ * scanner.c (load_line): Return if line was truncated.
+ No longer warn for truncated lines. Remove unused parameters.
+ (load_file): Store load_line return value to linebuf.
+ (gfc_error_recovery): Do not advance line at the end.
+
2005-04-14 Steven G. Kargl <kargls@comcast.net>
* gfortran.h (gfc_real_info): Add subnormal struct member.
if (c == delim)
break;
if (c == '\n')
- goto done;
+ return;
if (c == '\\')
{
c = next_char ();
if (c == '\n')
- goto done;
+ return;
}
}
if (gfc_at_eof ())
break;
}
-
-done:
- if (c == '\n')
- gfc_advance_line ();
}
need be.
In fixed mode, we expand a tab that occurs within the statement
label region to expand to spaces that leave the next character in
- the source region. */
+ the source region.
+ load_line returns wether the line was truncated. */
-static void
-load_line (FILE * input, char **pbuf, char *filename, int linenum)
+static int
+load_line (FILE * input, char **pbuf)
{
- int c, maxlen, i, trunc_flag, preprocessor_flag;
+ int c, maxlen, i, preprocessor_flag;
+ int trunc_flag = 0;
static int buflen = 0;
char *buffer;
c = fgetc (input);
if (c == '\n' || c == EOF)
break;
-
- if (gfc_option.warn_line_truncation
- && trunc_flag
- && !gfc_is_whitespace (c))
- {
- gfc_warning_now ("%s:%d: Line is being truncated",
- filename, linenum);
- trunc_flag = 0;
- }
}
ungetc ('\n', input);
*buffer++ = ' ';
*buffer = '\0';
+
+ return trunc_flag;
}
for (;;)
{
- load_line (input, &line, filename, current_file->line);
+ int trunc = load_line (input, &line);
len = strlen (line);
if (feof (input) && len == 0)
b->linenum = current_file->line++;
#endif
b->file = current_file;
+ b->truncated = trunc;
strcpy (b->line, line);
if (line_head == NULL)