Gnu C/Fortran bug?

Mehry Yazdanian m_yazdanian@lbl.gov
Fri Apr 12 11:56:00 GMT 2002


I have a simple program which works fine under Solaris/unix but does not
work correctly under Linux.
Here are the versions I am using:
RedHat Linux version 7.1
gcc version 2.96
g77 version 2.96
I have a fortran 3 line program which calls a C routine which reads from
stdin using fgets and then echoes back what is typed, using fputs. That
works ok but when it returns from the c call in fortran, it should type
on the screen "Returned From Subroutine". But instead it types "Returned
from Subroutine", when it is waiting for the user to type the line. when
it echoes the line after reading it, it prints on the screen "Returned
from Subroutine" again.
I compile as following:
gcc -c geti.c
g77 -o test_fgets test_fgets.f geti.o
Is this a bug?
I am attaching the code for this (2 files, a fortran program and c
subroutine) .
Thanks;
--Mehry Yazdanian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_fgets.f
Type: application/x-unknown-content-type-f_auto_file
Size: 149 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20020412/51f19fe0/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: geti.c
Type: application/x-unknown-content-type-c_auto_file
Size: 278 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20020412/51f19fe0/attachment-0001.bin>


More information about the Gcc-bugs mailing list