This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/20108] incorrect run time error on formatted read
- From: "coudert at clipper dot ens dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Feb 2005 16:34:44 -0000
- Subject: [Bug fortran/20108] incorrect run time error on formatted read
- References: <20050220190009.20108.dir@lanl.gov>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From coudert at clipper dot ens dot fr 2005-02-21 16:34 -------
gfortran seems to handle incorrectly the case when we ask for more integers than
we provide (Intel compiler, for example, set j and k to 0 in the following
case). Reduced testcase:
$ cat a.f
program main
implicit none
integer i,j,k
character c
read(5,'(a1,3i5)') c,i,j,k
end
$ cat data
c 1
c 1
The error message is:
At line 5 of file a.f
Fortran runtime error: Bad value during integer read
If the second line of the data file is removed, the message becomes:
"Fortran runtime error: End of file"
Reproduced on i686-linux and sparc-sun-solaris2.9
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20108