This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/18653] New: open call should open for read-only if open for read/write fails.
- From: "sje at cup dot hp dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Nov 2004 17:46:12 -0000
- Subject: [Bug libfortran/18653] New: open call should open for read-only if open for read/write fails.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
If we have the following program:
OPEN(10,FILE='wup.in',STATUS='OLD')
CLOSE(10, STATUS='KEEP')
END
And a data file that is readable by everyone and writable by nobody:
$ ll wup.in
-r--r--r-- 1 sje other 0 Nov 24 08:43 wup.in
gfortran will fail on the open (because it tries to open for read & write),
other compilers will open for read-only if they cannot open for reading and
writing.
Opening for read-only is not required by the Fortran standard but it is how
most Fortran compilers (HP, Intel, g77) behave.
--
Summary: open call should open for read-only if open for
read/write fails.
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libfortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sje at cup dot hp dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: ia64-hp-hpux11.23
GCC host triplet: ia64-hp-hpux11.23
GCC target triplet: ia64-hp-hpux11.23
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18653