[patch, libgfortran] PR58324 Bogus END-of-line error with list-directed I/O
Jerry DeLisle
jvdelisle@charter.net
Sat Mar 15 02:46:00 GMT 2014
The attached patch fixes this problem by first reading the next available char
to see if EOF is encountered. If so, issue the EOF error. If not use eat_line
to find the end of the line. If the end of the line is at the end of the file,
it will be caught on any subsequent attempt to read.
The problem particularly manifests for empty reads that do no other actual file
reading except in (finish_list_read).
Regression tested on x86-64-linux-gnu. NIST tested. test case provided.
Ok for trunk?
Regards,
Jerry
2014-03-14 Jerry DeLisle <jvdelisle@gcc.gnu>
PR libfortran/58324
* io/list_read.c (finish_list_read): Read one character to check
for the end of the file. If it is the end, then issue the file
end error message. If not, use eat_line to reach the end
without giving error. The next attempt to read will then
issue the error as described above.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr58324.diff
Type: text/x-patch
Size: 752 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140315/dfcaf5fb/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr58324.f90
Type: text/x-fortran
Size: 248 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140315/dfcaf5fb/attachment-0001.bin>
More information about the Gcc-patches
mailing list