[Bug fortran/19568] New: incorrect formatted read
gay at sfu dot ca
gcc-bugzilla@gcc.gnu.org
Fri Jan 21 17:46:00 GMT 2005
gfortran formatted read incorrectly reads beyond end of record when
record length is < io,format length.
Demo:
ian@ian:~/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
ian@ian:~/source/test> cat input_file
Line 1
Line 2
Line 3
Line 4
ian@ian:~/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)
ian@ian:~/source/test> gfortran -o ftest ftest.f95
ian@ian:~/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
More information about the Gcc-bugs
mailing list