------- Additional Comments From stevenj at alum dot mit dot edu 2005-05-24
23:51 -------
I doubt that merely omitting close() from the end of the library will entirely
fix the problem. You really need to add an fflush before every output to stdio.
For example, modify ciotst.f to:
program ciotst
call cio
write(*,*) 'Hello world.'
call cio
end
The g77 output is:
foo
bar
baz Hello world.
foo
bar
baz
as you would expect, but the gfortran output is in the wrong order (as well as
missing the final "baz" in my unpatched gfortran) because of missing flushes:
foo
bar
Hello world.
bazfoo
bar
(If you look in libf2c you'll see that it uses fflush in a number of places.)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20179