public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/28335]  New: flush() / write() statement on closed units - error?
@ 2006-07-11  9:04 tobias dot burnus at physik dot fu-berlin dot de
  2006-07-18 10:47 ` [Bug fortran/28335] " fxcoudert at gcc dot gnu dot org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: tobias dot burnus at physik dot fu-berlin dot de @ 2006-07-11  9:04 UTC (permalink / raw)
  To: gcc-bugs

The Fortran 2003 standard declares:
"Every input/output statement except an OPEN, CLOSE, INQUIRE, or WAIT statement
shall refer to a unit that is connected to a file"

gfortran does not give a run-time error. However, I don't know whether one
should enforce the standard (and thus do this check).

program test
  write(*,*) 'Hello'
  flush(6) ! preconnected unit (stdout)
  flush(99)! preconnected unit
 ! flush()  ! invalid
  close(88) ! close preconnected unit <<<<<<<<
  close(88) ! close once more
  ! wait(88) ! not supported by gfortran
  flush(88) ! invalid    <<<<<<<<<<<<<
  write(88,*) 'This should also produce an error' !<<<<<<
end program test

Expected: Like NAG f95 (or g95)
 Hello
Unit 88 is not connected
Program terminated by fatal I/O error
In TEST, line 9 of flush.f90


-- 
           Summary: flush() / write() statement on closed units - error?
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tobias dot burnus at physik dot fu-berlin dot de


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


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

end of thread, other threads:[~2006-07-31  2:02 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-11  9:04 [Bug fortran/28335] New: flush() / write() statement on closed units - error? tobias dot burnus at physik dot fu-berlin dot de
2006-07-18 10:47 ` [Bug fortran/28335] " fxcoudert at gcc dot gnu dot org
2006-07-25  5:10 ` patchapp at dberlin dot org
2006-07-26  1:47 ` jvdelisle at gcc dot gnu dot org
2006-07-26  1:51 ` jvdelisle at gcc dot gnu dot org
2006-07-26  6:23 ` [Bug fortran/28335] [4.1 only] " fxcoudert at gcc dot gnu dot org
2006-07-27  1:01 ` jvdelisle at gcc dot gnu dot org
2006-07-27  5:13 ` jvdelisle at gcc dot gnu dot org
2006-07-27  5:14 ` jvdelisle at gcc dot gnu dot org
2006-07-30 23:12 ` steven at gcc dot gnu dot org
2006-07-30 23:13 ` steven at gcc dot gnu dot org
2006-07-30 23:15 ` [Bug fortran/28335] [4.2 Regression] " steven at gcc dot gnu dot org
2006-07-31  0:09 ` jvdelisle at gcc dot gnu dot org
2006-07-31  0:15 ` jvdelisle at gcc dot gnu dot org
2006-07-31  1:32 ` jvdelisle at gcc dot gnu dot org
2006-07-31  1:36 ` jvdelisle at gcc dot gnu dot org
2006-07-31  1:57 ` jvdelisle at gcc dot gnu dot org
2006-07-31  2:02 ` jvdelisle at gcc dot gnu dot 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).