public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/105456] New: Child I/O does not propage iostat
@ 2022-05-02 16:49 tkoenig at gcc dot gnu.org
  2022-05-02 16:50 ` [Bug libfortran/105456] " tkoenig at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2022-05-02 16:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105456

            Bug ID: 105456
           Summary: Child I/O does not propage iostat
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tkoenig at gcc dot gnu.org
  Target Milestone: ---

The program

module sk1
  implicit none
  type char
     character :: ch
  end type char
  interface read (formatted)
     module procedure read_formatted
  end interface read (formatted)
contains
  subroutine read_formatted (dtv, unit, iotype, vlist, iostat, iomsg)
    class (char), intent(inout) :: dtv
    integer, intent(in) :: unit
    character (len=*), intent(in) :: iotype
    integer, intent(in) :: vlist(:)
    integer, intent(out) :: iostat
    character (len=*), intent(inout) :: iomsg
    character :: ch
    read (unit,fmt='(A1)', advance="no", iostat=iostat, iomsg=iomsg) ch
    iostat = 42
    dtv%ch = ch
  end subroutine read_formatted
end module sk1

program skip1
  use sk1
  implicit none
  type (char) :: x
  open (10,status="scratch")
  write (10,'(A)') '', 'a'
  rewind (10)
  read (10,*) x
  write (*,'(10(A))') "Read: '",x%ch,"'"
end program skip1

runs to completion, but it should propagate the iostat to the
caller and error out on the read.

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

end of thread, other threads:[~2024-03-12  1:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-02 16:49 [Bug libfortran/105456] New: Child I/O does not propage iostat tkoenig at gcc dot gnu.org
2022-05-02 16:50 ` [Bug libfortran/105456] " tkoenig at gcc dot gnu.org
2023-04-26  6:56 ` rguenth at gcc dot gnu.org
2023-07-27  9:23 ` rguenth at gcc dot gnu.org
2023-08-15  3:10 ` jvdelisle at gcc dot gnu.org
2024-02-22 19:13 ` jvdelisle at gcc dot gnu.org
2024-02-25 22:55 ` cvs-commit at gcc dot gnu.org
2024-03-06  4:54 ` cvs-commit at gcc dot gnu.org
2024-03-07  3:58 ` cvs-commit at gcc dot gnu.org
2024-03-12  1:08 ` jvdelisle at gcc dot gnu.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).