g77 bug? "I/O recursion" -- very annoying
Mumit Khan
khan@xraylith.wisc.edu
Fri Oct 24 00:05:00 GMT 1997
I just noticed someting that was definitely not present in earlier
versions of libf2c (eg., in that supplied with 0.5.19.1). If you
interrupt a program while it's doing I/O, it acts quite unreasonably.
Here's an example:
====
% ./g77-io-bug
At the following prompt either enter an integer
or hit control-c to see what happens
Enter an integer or Hit Ctrl-C now: Interrupt
I/O recursion: I/O started while already doing I/O
apparent state: unit 5 (unnamed)
last format: list io
lately reading sequential formatted external IO
Abort (core dumped)
====
Here's the code:
=======================
program annoyance
c
integer i
c
write (*,*) 'At the following prompt either enter an integer'
write (*,*) ' or hit control-c to see what happens'
write (*,'(A$)') 'Enter an integer or Hit Ctrl-C now: '
read (*,*) i
write (*,*) 'Number is ', i
stop
end
=======================
I can reproduce this behaviour under i386-linux-gnulibc1 and
i386-cygwin32.
Anybody know what caused this?
Regards,
Mumit -- khan@xraylith.wisc.edu
http://www.xraylith.wisc.edu/~khan/
More information about the Gcc-bugs
mailing list