public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/23598] New: iostat handling after library error return
@ 2005-08-27 22:12 tkoenig at gcc dot gnu dot org
  2005-08-28 11:05 ` [Bug libfortran/23598] " tkoenig at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2005-08-27 22:12 UTC (permalink / raw)
  To: gcc-bugs

$ 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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-08-29 20:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-27 22:12 [Bug libfortran/23598] New: iostat handling after library error return tkoenig at gcc dot gnu dot org
2005-08-28 11:05 ` [Bug libfortran/23598] " tkoenig at gcc dot gnu dot org
2005-08-29 20:44 ` cvs-commit at gcc dot gnu dot org
2005-08-29 20:51 ` cvs-commit at gcc dot gnu dot org
2005-08-29 20:57 ` tkoenig at gcc dot gnu dot org
2005-08-29 20:59 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).