This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: FORTRAN tty input/output bug
- To: derry dot birse at ind dot alstom dot com
- Subject: Re: FORTRAN tty input/output bug
- From: craig at jcb-sc dot com
- Date: 23 Apr 1999 18:12:44 -0000
- Cc: egcs-bugs at cygnus dot com
- Cc: craig at jcb-sc dot com
- References: <C125675C.005D4AC1.00@mz02world.hq.dtr.gecalsthom.fr>
>The following bug was discovered when porting a mixture of C and FORTRAN
>software from a Solaris 2 system using the Sun Workshop compilers to a Linux box
>kited out with egcs 1.0.3 release, and gcc 2.7.2.3.
Fortran I/O doesn't mix well with other I/O models, such as the C model
(even when accessed via g77's libU77). I believe the g77 docs include
some explanation of this, though perhaps they could be improved.
So, basically, you either do all your I/O (to a unit, most safely in
your entire program) via Fortran I/O -- OPEN/CLOSE/INQUIRE/READ/WRITE --
or you do it all via the underlying C I/O library, meaning open, fopen,
read, write, and so on.
Also, Fortran I/O doesn't mix well with *itself* when compiled by
different compilers into a single program, unless they're cooperating
somehow (as in the case of g77 and f2c), FWIW.
tq vm, (burley)