public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/20131] New: gfortan - incorrectly reads beyond the end of line.
@ 2005-02-22  7:17 dir at lanl dot gov
  2005-02-22  9:56 ` [Bug libfortran/20131] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: dir at lanl dot gov @ 2005-02-22  7:17 UTC (permalink / raw)
  To: gcc-bugs

I finally realized that this is actually the source of most of the data reading
problems that I have had. If you look at the hex dump of the file, the first
line has extra padding blanks and reads correctly. The second line has no
padding and gfortran reads past the end of line and takes data from the third
line and prints it.


[dir:~/tests/gfortran] dir% gfortran -o fread03 fread03.f
[dir:~/tests/gfortran] dir% fread03 < fread03.dat
    1    0
    1    2
STOP 0
[dir:~/tests/gfortran] dir% cat fread03.f
      program main
      do 10 j=1,2 
      read(5,1010)  nload,npr2
      write(6,1010) nload,npr2
   10 continue
 1010 format (16i5)
      stop
      end

[dir:~/tests/gfortran] dir% cat fread03.dat
    1          
    1
    2
[dir:~/tests/gfortran] dir% dump -i fread03.dat

   File name: fread03.dat   Block number: 0   Byte number: 0

0000  20 20 20 20 31 20 20 20  20 20 20 20 20 20 20 0a      1           .
0010  20 20 20 20 31 0a 20 20  20 20 32 0a 00 00 00 00      1.     2.
EOF encountered. Do you want to continue ? n

-- 
           Summary: gfortan - incorrectly reads beyond the end of line.
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dir at lanl dot gov
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: powerpc-apple-darwin7.8.0


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


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

end of thread, other threads:[~2005-06-05  7:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-22  7:17 [Bug fortran/20131] New: gfortan - incorrectly reads beyond the end of line dir at lanl dot gov
2005-02-22  9:56 ` [Bug libfortran/20131] " pinskia at gcc dot gnu dot org
2005-02-23 15:45 ` Thomas dot Koenig at online dot de
2005-02-24 11:45 ` Thomas dot Koenig at online dot de
2005-03-06 23:34 ` Thomas dot Koenig at online dot de
2005-03-08  8:20 ` Thomas dot Koenig at online dot de
2005-04-10  8:36 ` cvs-commit at gcc dot gnu dot org
2005-04-10  8:41 ` tkoenig at gcc dot gnu dot org
2005-05-03 19:41 ` [Bug libfortran/20131] [4.0 only] " cvs-commit at gcc dot gnu dot org
2005-05-03 19:48 ` tkoenig at gcc dot gnu dot org
2005-06-05  7:44 ` pinskia 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).