This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Fortran standard question: open()
- From: Paul Brook <paul at codesourcery dot com>
- To: fortran at gcc dot gnu dot org,sje at cup dot hp dot com
- Date: Wed, 24 Nov 2004 17:28:41 +0000
- Subject: Re: Fortran standard question: open()
- Organization: CodeSourcery
- References: <200411241706.JAA17187@hpsje.cup.hp.com>
On Wednesday 24 November 2004 17:06, Steve Ellcey wrote:
> I have noticed a difference between the HP Fortran compiler and gfortran
> and was wondering if someone familiar with the Fortran standard could
> tell me if this is a bug or just an implementation difference.
>
> 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
>
>
> Then when I use the HP compiler to build the program it runs fine, but
> if I use gfortran, it fails. Obviously gfortran is trying to open the
> file for reading and writing (since I didn't specify) and the open is
> failing. If I give myself write permssion to the file, the gfortran
> compiled program runs fine.
>
> Is this a compiler bug?
Section 9.3.4.8 says that the default value for ACTION= in an open statement
is processor dependent. This basically means the compiler gets to decide what
it wants to do.
g77 and Intel Fortran agree with HP Fortran, so I consider this a bug even
though it isn't technically required by the standard.
Please file a bug report.
Paul