public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/40334]  New: 4.5 regression: changed BACKSPACE behaviour at end of file.
@ 2009-06-04  0:29 bartoldeman at users dot sourceforge dot net
  2009-06-04  0:30 ` [Bug libfortran/40334] " bartoldeman at users dot sourceforge dot net
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: bartoldeman at users dot sourceforge dot net @ 2009-06-04  0:29 UTC (permalink / raw)
  To: gcc-bugs

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


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

end of thread, other threads:[~2009-06-09 20:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-04  0:29 [Bug libfortran/40334] New: 4.5 regression: changed BACKSPACE behaviour at end of file bartoldeman at users dot sourceforge dot net
2009-06-04  0:30 ` [Bug libfortran/40334] " bartoldeman at users dot sourceforge dot net
2009-06-04  1:13 ` jvdelisle at gcc dot gnu dot org
2009-06-04  1:15 ` [Bug libfortran/40334] 4.4,4.5 " jvdelisle at gcc dot gnu dot org
2009-06-04  6:41 ` [Bug libfortran/40334] [4.4, 4.5 Regression] " burnus at gcc dot gnu dot org
2009-06-04 11:39 ` [Bug libfortran/40334] [4.4/4.5 " rguenth at gcc dot gnu dot org
2009-06-06 16:08 ` jvdelisle at gcc dot gnu dot org
2009-06-06 16:09 ` jvdelisle at gcc dot gnu dot org
2009-06-07 17:40 ` jvdelisle at gcc dot gnu dot org
2009-06-09  3:15 ` jvdelisle at gcc dot gnu dot org
2009-06-09  3:18 ` jvdelisle at gcc dot gnu dot org
2009-06-09  3:19 ` jvdelisle at gcc dot gnu dot org
2009-06-09 20:30 ` jb 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).