This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/44477] Sequential I/O with END FILE: File position should be at EoF
- From: "kargl at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Jun 2010 16:41:12 -0000
- Subject: [Bug fortran/44477] Sequential I/O with END FILE: File position should be at EoF
- References: <bug-44477-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from kargl at gcc dot gnu dot org 2010-06-20 16:41 -------
(In reply to comment #7)
> The following occurs in the snapshot of June 19, but not in earlier snapshots:
>
> mrichmon@msc545ux:~$ cat test.f90
> PROGRAM test
> END FILE 10
> END FILE 10
> END PROGRAM test
> mrichmon@msc545ux:~$ gfortran test.f90
> mrichmon@msc545ux:~$ ./a.out
> At line 3 of file test.f90 (unit = 10, file = 'fort.10')
> Fortran runtime error: Cannot perform ENDFILE on a file already positioned
> after the EOF marker
>
Did you read the error message? The code is invalid. For the Fortran 95
standard:
After execution of an ENDFILE statement, a BACKSPACE or REWIND
statement shall be used to reposition the file prior to execution
of any data transfer input/output statement or ENDFILE statement.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44477