gfortran formatted read incorrectly reads beyond end of record when
record length is < io,format length.

Demo:
[EMAIL PROTECTED]:~/source/test> cat ftest.f95
program ftest
  integer i
  character*1 b(10)

  open (77, file='input_file')
  read (77, '(10A1)') b
  print *, b
end program ftest

[EMAIL PROTECTED]:~/source/test> cat input_file
Line 1
Line 2
Line 3
Line 4

[EMAIL PROTECTED]:~/source/test> gfortran -v
Using built-in specs.
Configured with: ../gcc/configure --enable-languages=c,f95
--prefix=/usr/work/2005020/irun
Thread model: posix
gcc version 4.0.0 20050120 (experimental)

[EMAIL PROTECTED]:~/source/test> gfortran -o ftest ftest.f95
[EMAIL PROTECTED]:~/source/test> ./ftest
 Line 1 Lin

-- 
           Summary: incorrect formatted read
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gay at sfu dot ca
                CC: gcc-bugs at gcc dot gnu dot org


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

Reply via email to