------- Additional Comments From stevenj at alum dot mit dot edu  2005-05-25 
16:47 -------
It was already noted above that adding fflush to the user's code would fix the
output.  As a quality-of-implementation issue, however, I would suggest that
libgfortran should do it.

1) Interoperating well with code in other languages, and especially with C (the
de facto lingua franca) is increasingly important nowadays.

2) libc is the most common way to write to stdio.  Arguably, the onus is on code
using other libraries to interoperate well with it, rather than vice versa. 
(We're not talking about C code with some random home-brewed I/O library here.)

3) Fortran 2000 has a standard way to call C functions in libraries that may not
have been designed to be called from non-C languages, and it won't always be
practical to modify the C code to call fflush (e.g. the source may not even be
available).  Nor can the Fortran user herself easily call fflush(stdout),
because that call is not available (?) in Fortran.  Hence, if it is to be done
at all in such cases, it has to be done in libgfortran.

4) If the performance loss of calling fflush before outputting to stdio in
libgfortran is negligible (I have no data, just a guess), why is this even a
question?

-- 


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

Reply via email to