This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/56555] New: read from pipe
- From: "furue at hawaii dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 07 Mar 2013 00:25:59 +0000
- Subject: [Bug fortran/56555] New: read from pipe
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56555
Bug #: 56555
Summary: read from pipe
Classification: Unclassified
Product: gcc
Version: 4.7.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: furue@hawaii.edu
When reading from stdin in a simple pipe, the Fortran runtime reports an "End
of file" error. See the self contained example below. It was done on a
Debian-testing system. The shell is a symlink to /bin/dash .
Regards,
Ryo
---------------------------------------
$ cat try.f90
program try
real(4):: r
integer:: i
do !! infinite loop
read(*,*) r
write(*,*) r
end do
end program try
$ gfortran -o try try.f90
$ cat try.sh
#!/bin/sh
for n in `seq 1 10`; do
echo $n | ./try
done
$ sh try.sh
1.00000000
At line 5 of file try.f90 (unit = 5, file = 'stdin')
Fortran runtime error: End of file
2.00000000
At line 5 of file try.f90 (unit = 5, file = 'stdin')
Fortran runtime error: End of file
3.00000000
At line 5 of file try.f90 (unit = 5, file = 'stdin')
Fortran runtime error: End of file
4.00000000
At line 5 of file try.f90 (unit = 5, file = 'stdin')
Fortran runtime error: End of file
5.00000000
At line 5 of file try.f90 (unit = 5, file = 'stdin')
Fortran runtime error: End of file
6.00000000
At line 5 of file try.f90 (unit = 5, file = 'stdin')
Fortran runtime error: End of file
7.00000000
At line 5 of file try.f90 (unit = 5, file = 'stdin')
Fortran runtime error: End of file
8.00000000
At line 5 of file try.f90 (unit = 5, file = 'stdin')
Fortran runtime error: End of file
9.00000000
At line 5 of file try.f90 (unit = 5, file = 'stdin')
Fortran runtime error: End of file
10.0000000
At line 5 of file try.f90 (unit = 5, file = 'stdin')
Fortran runtime error: End of file
$