From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21571 invoked by alias); 24 Mar 2003 14:16:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 21556 invoked by uid 71); 24 Mar 2003 14:16:01 -0000 Date: Mon, 24 Mar 2003 14:26:00 -0000 Message-ID: <20030324141601.21555.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Tim Prince Subject: Re: fortran/10197: direct acces files not unformatted by default Reply-To: Tim Prince X-SW-Source: 2003-03/txt/msg01592.txt.bz2 List-Id: The following reply was made to PR fortran/10197; it has been noted by GNATS. From: Tim Prince To: bdavis9659@comcast.net, gcc-gnats@gcc.gnu.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@comcast.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