From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12199 invoked by alias); 24 Nov 2004 17:46:19 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 12116 invoked by uid 48); 24 Nov 2004 17:46:12 -0000 Date: Wed, 24 Nov 2004 17:46:00 -0000 From: "sje at cup dot hp dot com" To: gcc-bugs@gcc.gnu.org Message-ID: <20041124174609.18653.sje@cup.hp.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug libfortran/18653] New: open call should open for read-only if open for read/write fails. X-Bugzilla-Reason: CC X-SW-Source: 2004-11/txt/msg02894.txt.bz2 List-Id: 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