https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108680
--- Comment #4 from anlauf at gcc dot gnu.org --- (In reply to Jerry DeLisle from comment #3) > I just circled back on this one. If I modify the test case to explicitly > define the interface to use integer(8) like this: [...] > SUBROUTINE my_write_routine_formatted (dtv, unit, iotype, v_list, iostat, > iomsg) > ! the derived-type value/variable > dtv-type-spec , INTENT(IN) :: dtv > INTEGER, INTENT(IN) :: unit > ! the edit descriptor string > CHARACTER (LEN=*), INTENT(IN) :: iotype > INTEGER, INTENT(IN) :: v_list(:) > INTEGER, INTENT(OUT) :: iostat > CHARACTER (LEN=*), INTENT(INOUT) :: iomsg > END > > Indeed, the unit is defined as default integer, which for gfortran is > kind=4. The option -fdefault-integer=8 is an extension falling outside the > Fortran Standards so the test case is in a sense invalid. I will change > this to an ENHANCEMENT and not really a bug. I think we could outright > reject it as invalid. The standard does no longer restrict unit or iostat to be a default integer. Nowadays, there is a requirement for iostat to have a decimal exponent range of at least four, but this is certainly the case for integer(8). We might need to audit the argument checks for (IO)STAT type variables.