This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/23598] New: iostat handling after library error return
- From: "tkoenig at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Aug 2005 22:12:23 -0000
- Subject: [Bug libfortran/23598] New: iostat handling after library error return
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
$ cat tst.f90
program main
real :: a
integer :: ios
open (10, pad='no')
write (10, '(A)') '1','1'
rewind (10)
read (10,'(I2)',iostat=ios) i
ios = -4321
read (10, '(I1)', iostat=ios) i
print *,ios
end program main
$ gfortran tst.f90
$ ./a.out
-4321
Here's a patch:
Index: lock.c
===================================================================
RCS file: /cvs/gcc/gcc/libgfortran/io/lock.c,v
retrieving revision 1.8
diff -c -p -r1.8 lock.c
*** lock.c 17 Aug 2005 02:48:56 -0000 1.8
--- lock.c 27 Aug 2005 22:10:48 -0000
*************** library_start (void)
*** 54,60 ****
stay within the library. */
g.in_library = 1;
! if (ioparm.iostat != NULL && ioparm.library_return == LIBRARY_OK)
*ioparm.iostat = ERROR_OK;
ioparm.library_return = LIBRARY_OK;
--- 54,60 ----
stay within the library. */
g.in_library = 1;
! if (ioparm.iostat != NULL)
*ioparm.iostat = ERROR_OK;
ioparm.library_return = LIBRARY_OK;
--
Summary: iostat handling after library error return
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P2
Component: libfortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tkoenig at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23598