From 2558e2e838790ef1441788c0ba4c14e1bf061b55 Mon Sep 17 00:00:00 2001 From: Jerry DeLisle Date: Sat, 11 Jan 2014 18:57:20 +0000 Subject: re PR fortran/59700 (Misleading/buggy runtime error message: Bad integer for item 0 in list input) 2014-01-11 Jerry DeLisle Dominique d'Humieres Steven G. Kargl PR libfortran/59700 PR libfortran/59764 * io/io.h (struct st_parameter_dt): Assign expanded_read flag to unused bit. Define new variable line_buffer_pos. * io/list_read.c (free_saved, next_char, l_push_char, read_logical, read_real): Replace use of item_count with line_buffer_pos for line_buffer look ahead. (read_logical, read_integer, parse_real, read_real, check_type): Adjust location of free_line to after generating error messages to retain the correct item count for the message. Co-Authored-By: Dominique d'Humieres Co-Authored-By: Steven G. Kargl From-SVN: r206553 --- libgfortran/io/io.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libgfortran/io/io.h') diff --git a/libgfortran/io/io.h b/libgfortran/io/io.h index 97f7a6a..3481c83 100644 --- a/libgfortran/io/io.h +++ b/libgfortran/io/io.h @@ -430,7 +430,10 @@ typedef struct st_parameter_dt unsigned g0_no_blanks : 1; /* Used to signal use of free_format_data. */ unsigned format_not_saved : 1; - /* 14 unused bits. */ + /* A flag used to identify when a non-standard expanded namelist read + has occurred. */ + unsigned expanded_read : 1; + /* 13 unused bits. */ /* Used for ungetc() style functionality. Possible values are an unsigned char, EOF, or EOF - 1 used to mark the @@ -447,9 +450,8 @@ typedef struct st_parameter_dt char *line_buffer; struct format_data *fmt; namelist_info *ionml; - /* A flag used to identify when a non-standard expanded namelist read - has occurred. */ - int expanded_read; + /* Current position within the look-ahead line buffer. */ + int line_buffer_pos; /* Storage area for values except for strings. Must be large enough to hold a complex value (two reals) of the largest kind. */ -- cgit v1.1