public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/32235]  New: gfortran - incorrectly position text file after backspace
@ 2007-06-06 16:16 dir at lanl dot gov
  2007-06-06 20:31 ` [Bug fortran/32235] " burnus at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: dir at lanl dot gov @ 2007-06-06 16:16 UTC (permalink / raw)
  To: gcc-bugs

g77, g95, Absoft 9.2, etc.. position the text file correctly, but gfortran is
off by one line -

[dranta:~/tests/gfortran-D] dir% gfortran -fno-automatic -std=legacy -o aRead01
aRead01.f
[dranta:~/tests/gfortran-D] dir% aRead01 < aRead01.in
                      1        one                                              
                      2        Two                                              
                      3        Three                                            
read =Two       
[dranta:~/tests/gfortran-D] dir% g77 -o aRead01 aRead01.f
[dranta:~/tests/gfortran-D] dir% aRead01 < aRead01.in
                      1        one                                              
                      2        Two                                              
                      3        Three                                            
read =Three     
[dranta:~/tests/gfortran-D] dir% cat aRead01.f
      program main
      character*10 a
      ncards=2
      read(5,1000)a
      read(5,1000)a
      call inlist(ncards)
      read(5,1000)a
      write(6,2000)a
      stop
 1000 format(a10)
 2000 format('read =',a10)
      end
      subroutine inlist(ncards)
      character*4 data(20)
      input=5
c
      if (ncards.eq.0) go to 20
      do 15 i=1,ncards
      backspace input
   15 continue
c
   20 continue
      kard  = 0
   30 read(5,1000,end=60)   data
   40 kard=kard + 1
   50 write (6,2020) kard,data
      go to 30
   60 continue
      kard=kard - ncards + 1
      do 70   i=1,kard
      backspace input
   70 continue
c
      return
c
 1000 format (20a4)
 2020 format (8x,i15,8x,20a4)
c
      end
[dranta:~/tests/gfortran-D] dir% cat aRead01.in
one                   
Two                   
Three                 
[dranta:~/tests/gfortran-D] dir% gfortran --v
Using built-in specs.
Target: powerpc-apple-darwin8.9.0
Configured with: ../gcc/configure --enable-checking --disable-multilib
--prefix=/usr/local/gfortran --enable-languages=c,fortran
Thread model: posix
gcc version 4.3.0 20070604 (experimental)


-- 
           Summary: gfortran - incorrectly position text file after
                    backspace
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dir at lanl dot gov
  GCC host triplet: powerpc-apple-darwin8.9.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32235


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

end of thread, other threads:[~2007-06-11 17:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-06 16:16 [Bug fortran/32235] New: gfortran - incorrectly position text file after backspace dir at lanl dot gov
2007-06-06 20:31 ` [Bug fortran/32235] " burnus at gcc dot gnu dot org
2007-06-07  0:14 ` jvdelisle at gcc dot gnu dot org
2007-06-07 13:14 ` dir at lanl dot gov
2007-06-09 19:28 ` jvdelisle at gcc dot gnu dot org
2007-06-09 19:37 ` [Bug fortran/32235] [4.3 Regression] " jvdelisle at gcc dot gnu dot org
2007-06-09 20:53 ` jvdelisle at gcc dot gnu dot org
2007-06-10  2:20 ` patchapp at dberlin dot org
2007-06-10 22:51 ` jvdelisle at gcc dot gnu dot org
2007-06-11  3:06 ` jvdelisle at gcc dot gnu dot org
2007-06-11 17:52 ` 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).