public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/48960] New: OPEN statement modifies NEWUNIT variable on error
@ 2011-05-11  8:51 thenlich at users dot sourceforge.net
  2011-05-12 18:39 ` [Bug libfortran/48960] " jvdelisle at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: thenlich at users dot sourceforge.net @ 2011-05-11  8:51 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48960

           Summary: OPEN statement modifies NEWUNIT variable on error
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: thenlich@users.sourceforge.net


If the NEWUNIT= specifier in the OPEN statement is used, the variable is
modified if an error occurs during the execution of the OPEN statement.

This does not conform to Fortran 2008 which demands:

9.5.6.12 NEWUNIT= specifier in the OPEN statement

1 The variable is defined with a processor determined NEWUNIT value if no error
occurs during the execution of the OPEN statement. If an error occurs, the
processor shall not change the value of the variable.

Example:

program test_newunit
    integer :: st, un = 0
    open (newunit=un, file='nonexisting.dat', status='old', iostat=st)
    if (un /= 0) call abort
end program test_newunit

Result: If the file 'nonexisting.dat' does not exist, the program aborts.

Expected result: If the file 'nonexisting.dat' does not exist, the program
should not abort.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-12-27 20:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-11  8:51 [Bug libfortran/48960] New: OPEN statement modifies NEWUNIT variable on error thenlich at users dot sourceforge.net
2011-05-12 18:39 ` [Bug libfortran/48960] " jvdelisle at gcc dot gnu.org
2012-12-25  4:24 ` jvdelisle at gcc dot gnu.org
2012-12-25  4:52 ` jvdelisle at gcc dot gnu.org
2012-12-26 18:12 ` jvdelisle at gcc dot gnu.org
2012-12-27  6:37 ` jvdelisle at gcc dot gnu.org
2012-12-27 20:14 ` jvdelisle at gcc dot gnu.org
2012-12-27 20:15 ` jvdelisle at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).