This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/24576] Fortran I/O to same unit number in main program and in a shared library
- From: "kargl at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Oct 2005 00:14:16 -0000
- Subject: [Bug libfortran/24576] Fortran I/O to same unit number in main program and in a shared library
- References: <bug-24576-11486@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from kargl at gcc dot gnu dot org 2005-10-29 00:14 -------
Intel and PGI are wrong according to the standard. Gfortran is
doing the right thing. See section 9.4 File Connection. In
particular "The external unit identified by a particular value of
a scalar-int-expr is the same external unit in all program units of
the program." Also, read Note 9.13. I'm here referencing
material from the Final Committee Draft for the Fortran 2003
standard.
You'll also find
Section 9.4.3 Connection of a file to a unit
An external unit has a property of being connected or not connected. If
connected, it refers to an external file. An external unit may become
connected by preconnection or by the execution of an OPEN statement. The
property of connection is symmetric; the unit is connected to a file if
and only if the file is connected to the unit.
In short, if you want to different files, then you need to have unique
unit numbers.
--
kargl at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24576