This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: fortran/10197: direct acces files not unformatted by default
- From: Tim Prince <timothyprince at sbcglobal dot net>
- To: nobody at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 24 Mar 2003 14:16:01 -0000
- Subject: Re: fortran/10197: direct acces files not unformatted by default
- Reply-to: Tim Prince <timothyprince at sbcglobal dot net>
The following reply was made to PR fortran/10197; it has been noted by GNATS.
From: Tim Prince <timothyprince at sbcglobal dot net>
To: bdavis9659 at comcast dot net, gcc-gnats at gcc dot gnu dot org
Cc:
Subject: Re: fortran/10197: direct acces files not unformatted by default
Date: Mon, 24 Mar 2003 06:15:26 -0800
On Sunday 23 March 2003 16:34, bdavis9659 at comcast dot net wrote:
> >Number: 10197
> >Category: fortran
> >Synopsis: direct acces files not unformatted by default
> OPEN(..ACCESS='DIRECT'..) should open a file with FORM='UNFORMATTED'.
>
> It is being opened with FORM='FORMATTED', which causes a runtime error on
> the first unformatted I/O.
>
> This is correct on g77 2.96, and not on the pre-release g77 3.3 or g77 3.4.
>
> At the risk of being proven wrong by a plethora of language lawyers:):)
>
> The FORTAN-77 standard, section 12.10.1 states; when discussing FORM=
>
> "If this specifier is omitted, a value of UNFORMATTED is assumed if the
> file is being connected for direct access, and a value of FORMATTED is
> assumed if the file is being connected for sequential access. "
>
> So, IMHO, this is how it should work.
>
> >How-To-Repeat:
>
> C demonstrate a direct access file is by default unformatted
> IMPLICIT NONE
> LOGICAL*4 ERROR /.FALSE./
> CHARACTER*12 FORM
> DATA FORM / '' /
> OPEN(UNIT=60,
> 1 ACCESS='DIRECT',
> 2 STATUS='SCRATCH',
> 3 RECL=255)
> INQUIRE(UNIT=60,FORM=FORM)
> IF (FORM.EQ.'UNFORMATTED') THEN
> PRINT*,'FORM IS ',FORM,' WHICH IS CORRECT.'
> ELSE
> PRINT*,'FORM IS ',FORM,' S/B UNFORMATTED.'
> ERROR = .TRUE.
> ENDIF
> CLOSE(UNIT=60)
> IF (ERROR) CALL ABORT
> END
>
I "sent mail to interested parties," but, AFAICT, all the interested parties
selected by gnats-web bounced my mail. I pointed out that the version of
open.c included in gcc-3.2.2 implements the standard, in accordance with
Bud's test. I rebuilt gcc-3.3 with that version of open.c, and it passed
Bud's test. So, gcc-3.3 has a regression from gcc-3.2.2, apparently caused
by an out of date libf2c.
--
Tim Prince