public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/43517]  New: spurious end-of-file condition when namelist read follows formatted read
@ 2010-03-25 15:02 michael dot a dot richmond at nasa dot gov
  2010-03-25 15:17 ` [Bug fortran/43517] " dominiq at lps dot ens dot fr
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: michael dot a dot richmond at nasa dot gov @ 2010-03-25 15:02 UTC (permalink / raw)
  To: gcc-bugs

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


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

end of thread, other threads:[~2010-03-26  5:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-25 15:02 [Bug fortran/43517] New: spurious end-of-file condition when namelist read follows formatted read michael dot a dot richmond at nasa dot gov
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

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).