This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/40334] New: 4.5 regression: changed BACKSPACE behaviour at end of file.
- From: "bartoldeman at users dot sourceforge dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Jun 2009 00:29:26 -0000
- Subject: [Bug libfortran/40334] New: 4.5 regression: changed BACKSPACE behaviour at end of file.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following program (also attached) reads to eof, backspace, reads (eof
detected), backspace, and reads again. The last read gets the last line with
gfortran 4.5 (tested: r148116) but eof with gfortran <= 4.4, g95, g77 and Sun
f95.
>From reading comp.lang.fortran I know that EOF/BACKSPACE interaction can be
problematic but I'd still hope this would work to be consistent with the other
compilers.
PROGRAM TEST
IMPLICIT NONE
CHARACTER(LEN=5) :: STR
OPEN(2,FILE='fort.2',ACCESS='sequential')
WRITE(2,'(A)')'HELLO'
REWIND(2)
DO
READ(2,'(A)',END=1) STR
PRINT *,STR
ENDDO
1 BACKSPACE 2
!the file pointer is now at EOF
READ(2,*,END=2) STR
PRINT *,'error1: not at eof',str
STOP
2 BACKSPACE 2
!the file pointer is now at EOF
READ(2,'(A)',END=3) STR
PRINT *,'error2: not at eof'
STOP
3 PRINT *,'correct'
END
--
Summary: 4.5 regression: changed BACKSPACE behaviour at end of
file.
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libfortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bartoldeman at users dot sourceforge dot net
GCC build triplet: x86_64-unknown-linux-gnu
GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40334