This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libfortran/24576] Fortran I/O to same unit number in main program and in a shared library



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]