public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "tkoenig at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libfortran/23598] New: iostat handling after library error return
Date: Sat, 27 Aug 2005 22:12:00 -0000	[thread overview]
Message-ID: <20050827221221.23598.tkoenig@gcc.gnu.org> (raw)

$ 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


             reply	other threads:[~2005-08-27 22:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-27 22:12 tkoenig at gcc dot gnu dot org [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050827221221.23598.tkoenig@gcc.gnu.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).