This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/44477] Sequential I/O with END FILE: File position should be at EoF



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]