public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "manfred99 at gmx dot ch" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libfortran/59513] [4.8/4.9/4.10 Regression] Fortran runtime error: Sequential READ or WRITE not allowed after EOF marker, possibly use REWIND or BACKSPACE
Date: Tue, 15 Jul 2014 21:44:00 -0000	[thread overview]
Message-ID: <bug-59513-4-VBlURxGYYG@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-59513-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59513

Manfred Schwarb <manfred99 at gmx dot ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manfred99 at gmx dot ch

--- Comment #22 from Manfred Schwarb <manfred99 at gmx dot ch> ---
I just encountered the same issue, with some convoluted legacy code.
The scheme seems to be the same:

      READ(lun,END=100) buffer
100   WRITE(lun,*) "whatever"

As the used code definitely was used in practice, mainly before the year
2000, I guess that older compiler supported this.

And yes, the BACKSPACE() trick works. However, common sense suggest
that with END= we are at the end of the file. This sounds a bit like the
old joke, where you have a room with 5 people, you are taking 6 out, so
someone has to go in for the room to be empty. Beyond EOF simply does
not exist.

Jerry, concerning your cited standard:
"If the file contains an endfile record" suggests that there is some
special marker in the file to be read/written.
In this example, we are doing some formatted IO to a plain text file,
there are no special markers.
Do I miss something?

What does/should ftell() report in such a case? That we are one
character beyond EOF?


  parent reply	other threads:[~2014-07-15 21:44 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-59513-4@http.gcc.gnu.org/bugzilla/>
2013-12-15 22:19 ` [Bug libfortran/59513] " jvdelisle at gcc dot gnu.org
2013-12-15 22:33 ` aruopp at gmx dot de
2013-12-16  0:02 ` aruopp at gmx dot de
2013-12-18 14:53 ` aruopp at gmx dot de
2013-12-18 14:56 ` aruopp at gmx dot de
2013-12-18 14:57 ` aruopp at gmx dot de
2013-12-18 15:04 ` dominiq at lps dot ens.fr
2013-12-18 15:19 ` aruopp at gmx dot de
2013-12-18 16:23 ` dominiq at lps dot ens.fr
2013-12-18 16:35 ` [Bug libfortran/59513] [4.7/4.8/4.9] " dominiq at lps dot ens.fr
2013-12-19 15:21 ` rguenth at gcc dot gnu.org
2013-12-19 15:43 ` rguenth at gcc dot gnu.org
2014-05-27 13:01 ` giorgio.signorini at unifi dot it
2014-06-12 13:52 ` [Bug libfortran/59513] [4.8/4.9 Regression] " rguenth at gcc dot gnu.org
2014-07-11 17:33 ` [Bug libfortran/59513] [4.8/4.9/4.10 " dominiq at lps dot ens.fr
2014-07-12 11:39 ` dominiq at lps dot ens.fr
2014-07-12 13:11 ` dominiq at lps dot ens.fr
2014-07-12 13:24 ` dominiq at lps dot ens.fr
2014-07-12 18:02 ` dominiq at lps dot ens.fr
2014-07-12 19:43 ` jvdelisle at gcc dot gnu.org
2014-07-15 16:39 ` dominiq at lps dot ens.fr
2014-07-15 21:44 ` manfred99 at gmx dot ch [this message]
2014-07-15 22:07 ` dominiq at lps dot ens.fr
2014-07-16  1:45 ` jvdelisle at gcc dot gnu.org
2014-07-16 10:37 ` manfred99 at gmx dot ch
2014-07-16 10:49 ` manfred99 at gmx dot ch
2014-12-19 13:34 ` [Bug libfortran/59513] [4.8/4.9/5 " jakub at gcc dot gnu.org
2015-03-22 22:59 ` jvdelisle at gcc dot gnu.org
2015-03-22 23:56 ` jvdelisle at gcc dot gnu.org
2015-03-25 18:46 ` dominiq at lps dot ens.fr
2015-03-30 17:45 ` jvdelisle at gcc dot gnu.org
2015-03-30 21:59 ` jvdelisle at gcc dot gnu.org
2015-03-30 22:35 ` jvdelisle at gcc dot gnu.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=bug-59513-4-VBlURxGYYG@http.gcc.gnu.org/bugzilla/ \
    --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: link
Be 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).