https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117430
Bug ID: 117430 Summary: gfortran allows type(C_ptr) in I/O list Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: pault at gcc dot gnu.org Target Milestone: --- The test case in pr116388 has I/O lines like: type, public :: AType type(C_ptr) :: cptr = C_null_ptr ...snip... end type write(*,*) "B:", self%cptr, which are invalid because, as ifort puts it, "A derived-type object in an input/output list cannot have inaccessible components unless a suitable user-defined input/output procedure is available." nagfor agrees with this diagnosis. write(*,*) "A:", transfer (self%cptr, C_LONG_LONG) is accepted by all three compilers and gives the expected result. Paul