public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "michael dot a dot richmond at nasa dot gov" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/43517]  New: spurious end-of-file condition when namelist read follows formatted read
Date: Thu, 25 Mar 2010 15:02:00 -0000	[thread overview]
Message-ID: <bug-43517-14284@http.gcc.gnu.org/bugzilla/> (raw)

The following bug exists in all ports. It applies to gfortran 4.4.4 and 4.5. It
does not apply to gfortran 4.4.0, 4.4.1, 4.4.2, 4.4.3, or any 4.3 version.

I compile and run the following program:

PROGRAM main
NAMELIST /name/ j
OPEN (10,FILE='file.txt',STATUS='OLD',FORM='FORMATTED')
READ (10,5000) i, idum
5000 FORMAT(2I5,4X) ! This FORMAT is crucial to the bug
PRINT *, "i =", i, "as expected"
READ (10,name,END=999)
STOP
999 PRINT *, "Spurious end of file condition"
END PROGRAM main

The file.txt file contains the following:

999999
 $name
  j=0,
 /

The program prints:

 i =       99999 as expected
 Spurious end of file condition


-- 
           Summary: spurious end-of-file condition when namelist read
                    follows formatted read
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: michael dot a dot richmond at nasa dot gov
 GCC build triplet: all
  GCC host triplet: all
GCC target triplet: all


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


             reply	other threads:[~2010-03-25 15:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-25 15:02 michael dot a dot richmond at nasa dot gov [this message]
2010-03-25 15:17 ` [Bug fortran/43517] " dominiq at lps dot ens dot fr
2010-03-25 20:42 ` jvdelisle at gcc dot gnu dot org
2010-03-25 22:47 ` [Bug fortran/43517] [4.5 Regression] " jvdelisle at gcc dot gnu dot org
2010-03-26  3:24 ` jvdelisle at gcc dot gnu dot org
2010-03-26  3:26 ` jvdelisle at gcc dot gnu dot org
2010-03-26  3:29 ` [Bug fortran/43517] [4.4 " jvdelisle at gcc dot gnu dot org
2010-03-26  4:57 ` jvdelisle at gcc dot gnu dot org
2010-03-26  4:59 ` jvdelisle at gcc dot gnu dot org
2010-03-26  5:15 ` jvdelisle 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=bug-43517-14284@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).