public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "anlauf at hep dot tu-darmstadt dot de" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/16597] New: gfortran: bug in unformatted I/O on scratch files Date: Fri, 16 Jul 2004 21:07:00 -0000 [thread overview] Message-ID: <20040716210722.16597.anlauf@hep.tu-darmstadt.de> (raw) Hi all, there's apparently a bug in the runtime when handling unformatted I/O on scratch files. It reads back garbage after writing. Sample program: program gfbug4 implicit none integer strlen parameter (strlen = 4) integer iunit, i, k character string *4 do 10 i = 1, strlen string(i:i) = achar (i) 10 continue iunit = 99 open (UNIT=iunit,FORM='unformatted',ACCESS='direct',RECL=strlen) write (iunit, rec=1) string read (iunit, rec=1) i close (iunit) print *, i open (UNIT=iunit,FORM='unformatted',ACCESS='direct', $ STATUS='scratch',RECL=strlen) write (iunit, rec=1) string read (iunit, rec=1) k close (iunit) print *, k if (i .eq. k) then print *, 'O.K.' else print *, '*** Bug! ***' endif end Result: % ./a.out 67305985 538976288 *** Bug! *** The first write to fort.99 and reading back works fine - it indicates that I/O has little-endian form, but the second is just 0x20202020. -- Summary: gfortran: bug in unformatted I/O on scratch files Product: gcc Version: 3.5.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: anlauf at hep dot tu-darmstadt dot de CC: gcc-bugs at gcc dot gnu dot org GCC host triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16597
next reply other threads:[~2004-07-16 21:07 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2004-07-16 21:07 anlauf at hep dot tu-darmstadt dot de [this message] 2004-07-17 0:58 ` [Bug libfortran/16597] " bdavis at gcc dot gnu dot org 2004-08-26 2:34 ` bdavis at gcc dot gnu dot org 2004-08-27 7:59 ` cvs-commit at gcc dot gnu dot org 2004-08-27 8:39 ` pinskia at gcc dot gnu dot org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20040716210722.16597.anlauf@hep.tu-darmstadt.de \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).