[Bug libfortran/20179] cannot mix C and Fortran I/O
fxcoudert at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Wed May 25 11:23:00 GMT 2005
------- Additional Comments From fxcoudert at gcc dot gnu dot org 2005-05-25 11:10 -------
In the modified program, calls to fflush are missing, but they are missing from
the C routine. The library does not use FILE* streams and, as far as I know, it
does its own flushing right.
The problem you mention could be avoided by a preemptive fflush(stdout), but
this is only working around the user's code problems: when you use two different
systems of I/O, you should take care that each cleans up its internal mess
before switching to the other one. gfortran did not do this properly, hence the
patch I submitted. Now, my opinion is that in the case of the code from comment
#8, it's up to the user to write his code more carefully.
As an addition to this opinion (I'll be glad to hear any other point of view),
here is a small "state-of-the-art" on this point: Intel, IBM compilers do as I
suggest here, while Portland, MIPSpro and Sun compilers do as you expect.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |fxcoudert at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2005-05-23 17:12:29 |2005-05-25 11:10:59
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20179
More information about the Gcc-bugs
mailing list