The program program test integer :: fh = 71 open(fh, file="f", form='unformatted', status='unknown') ! close(fh) open(fh, file="f", form='unformatted', status='unknown') end program
fails with At line 5 of file file-status-old.f90 Fortran runtime error: OPEN statement must have a STATUS of OLD The F2003 standard says that if status='unknown', which is the same as if no status specifier is present, then the status is processor dependent. So technically this is not a standard conformance bug, but it's still a problem for some real codes, and it doesn't cost us anything to allow it. Thanks to Bernhard Fischer for bringing up this problem. -- Summary: Reopening a file with STATUS='UNKNOWN' should work Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: jb at gcc dot gnu dot org ReportedBy: jb at gcc dot gnu dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25036