public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/14904] New: [gfortran]  INQUIRE returns incorrect LASTREC on multiple writes to DIRECT, FORMATTED units.
@ 2004-04-10  3:02 bdavis9659 at comcast dot net
  2004-04-10 14:05 ` [Bug libfortran/14904] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: bdavis9659 at comcast dot net @ 2004-04-10  3:02 UTC (permalink / raw)
  To: gcc-bugs

>From NIST test FM912.FOR.

When more than one record is written to a direct access formatted unit with one
write statement, inquire should increment LASTREC to reflect the number of
records written.  Currently, it assumes one write = one record written, which is
wrong.

Small example :

       OPEN(UNIT=10,ACCESS='DIRECT',FORM='FORMATTED',RECL=120)
 100   FORMAT(I4)
       WRITE(UNIT=10,REC=1,FMT=100)1
       INQUIRE(UNIT=10,NEXTREC=J)
       PRINT*,J
 200   FORMAT(I4,/,I4)
       WRITE(UNIT=10,REC=2,FMT=200)2,3
       INQUIRE(UNIT=10,NEXTREC=J)
       PRINT*,J
       END

$ gfc inquire.f
$ ./a.out
           2
           3
          ^^^ 
         should be 4

$ g77 inquire.f
$ ./a.out
 2
 4


$ gfortran --version
GNU Fortran 95 (GCC 3.5-tree-ssa 20040410 (merged 20040331))

-- 
           Summary: [gfortran]  INQUIRE returns incorrect LASTREC on
                    multiple writes to DIRECT, FORMATTED units.
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libfortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bdavis9659 at comcast dot net
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14904


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-04-11 17:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-10  3:02 [Bug libfortran/14904] New: [gfortran] INQUIRE returns incorrect LASTREC on multiple writes to DIRECT, FORMATTED units bdavis9659 at comcast dot net
2004-04-10 14:05 ` [Bug libfortran/14904] " pinskia at gcc dot gnu dot org
2004-04-11 19:11 ` cvs-commit at gcc dot gnu dot org
2004-04-11 19:22 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).