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/18982] New: open(status="new") does not generate an error if the file exists


$ cat open.f90
  nout = 10
  open(nout, file="foo.dat", status="new")
  close(nout)
  open(nout, file="foo.dat", status="new",err=100)  ! This should fail
  write(nout,*) "Hello"                     ! and not this.
100 continue
end
$ rm -f foo.dat
$ gfortran open.f90
$ ./a.out
At line 5 of file open.f90
Fortran runtime error: Cannot write to file opened for READ

-- 
           Summary: open(status="new") does not generate an error if the
                    file exists
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libfortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Thomas dot Koenig at online dot de
                CC: gcc-bugs at gcc dot gnu dot org


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


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