[Bug fortran/47694] [4.3/4.4/4.5/4.6 Regression] Fortran read from named pipe fails to read all available data

jb at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 15 09:50:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47694

--- Comment #11 from Janne Blomqvist <jb at gcc dot gnu.org> 2011-02-15 09:42:12 UTC ---
Unfortunately I don't think I'll have time to look into it this week.

As can be seen from Tobias patch, reading one character at a time is very slow.
But, the comment in read_sf() is wrong, it's not actually needed to read one
character at a time; what we need to do is to handle short reads correctly.

One fix, I suspect, would be to convert read_sf() to use fbuf_getc() instead,
which gives the impression of reading a character at a time, even though fbuf
takes care of doing buffered reads in the background. But in order to do that,
the read_sf() API needs to be changed so that a buffer is passed as an
argument, and this buffer is then filled with data, rather than returning a
pointer to the fbuf buffer.



More information about the Gcc-bugs mailing list