https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91556
--- Comment #21 from Steve Kargl <sgk at troutmask dot apl.washington.edu> --- On Thu, Aug 29, 2019 at 09:38:09PM +0000, tkoenig at gcc dot gnu.org wrote: > --- Comment #18 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- > (In reply to anlauf from comment #14) > > The current solution is a bit annoying for implicitly-derived interfaces. > > > > Consider a code like: > > > > module foo > > implicit none > > type t1 > > integer :: i = 1 > > end type t1 > > type t2 > > integer :: j = 2 > > end type t2 > > contains > > subroutine s1 (x) > > type(t1) :: x > > call my_mpi_bcast_wrapper (x, storage_size (x)/8) > > end subroutine s1 > > subroutine s2 (y) > > type(t2) :: y > > call my_mpi_bcast_wrapper (y, storage_size (y)/8) > > end subroutine s2 > > end module foo > > > > That's perfectly legal, > > This is illegal, as far as I know. The type names are different, > which makes them different types. > Thomas, I'll leave this to whatever you decide. gfortran could do -fallow-argument-mismatch=n. n=0 is an error, n=1 is for a warning, and n>1 silences the warning. n=0 would be the default setting as I think the error messages will encourage people to fix their codes. PS: the MPI argument is somewhat bogus. At least, OpenMPI has an Fortran 2008 interface for mpi_bcast() (ie., 11 years ago). USE mpi_f08 MPI_Bcast(buffer, count, datatype, root, comm, ierror) TYPE(*), DIMENSION(..) :: buffer INTEGER, INTENT(IN) :: count, root TYPE(MPI_Datatype), INTENT(IN) :: datatype TYPE(MPI_Comm), INTENT(IN) :: comm INTEGER, OPTIONAL, INTENT(OUT) :: ierror