[PATCH, fortran testsuite] read_eof.f90 open file bug
David Edelsohn
dje@watson.ibm.com
Wed Dec 29 16:11:00 GMT 2004
read_eof.f90 consistently fails on AIX during nightly testsing,
but not when run manually. Adding additional debugging statements to
new_unit() shows that it is failing because file /dev/null already is open
as unit 5. Unit 5 is associated with stdin and stdin is /dev/null when
not associated with a terminal.
The following patch opens a scratch file instead of explicitly
opening /dev/null. It also adds an explicit call to abort on failure.
Okay for mainline?
Thanks, David
* gfortran.fortran-torture/execute/read_eof.f90: Open scratch
file, not /dev/null. Abort on error.
Index: read_eof.f90
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gfortran.fortran-torture/execute/read_eof.f90,v
retrieving revision 1.2
diff -c -p -r1.2 read_eof.f90
*** read_eof.f90 13 May 2004 06:40:53 -0000 1.2
--- read_eof.f90 29 Dec 2004 15:49:25 -0000
***************
*** 1,5 ****
! PR 13919, segfault when file is empty
! open(unit=8,file='/dev/null')
read(8,*,end=1)i
1 continue
end
--- 1,6 ----
! PR 13919, segfault when file is empty
! open(unit=8,status='scratch')
read(8,*,end=1)i
+ call abort
1 continue
end
More information about the Fortran
mailing list