https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83458
Bug ID: 83458 Summary: F2008: inquire fails on units opened with newunit= Product: gcc Version: 7.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: daanvanvugt at gmail dot com Target Milestone: --- Whens trying to find information an a unit number this fails if the unit number is opened with newunit= I expect the program below to return a unit number < 0, ierr=0, T and the filename. program inquire_newunit integer :: un, ierr character(len=80) :: name_of_file logical :: openedq open(newunit=un, file="/dev/urandom", access="stream", & form="unformatted", action="read", status="old", iostat=ierr) inquire(number=un, opened=openedq, file=name_of_file) write(*,*) un, ierr, openedq write(*,*) name_of_file if (ierr == 0) then close(un) end if end program inquire_newunit