This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, fortran testsuite] read_eof.f90 open file bug
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org, Paul Brook <paul at codesourcery dot com>
- Date: Wed, 29 Dec 2004 11:10:01 -0500
- Subject: [PATCH, fortran testsuite] read_eof.f90 open file bug
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