Gcc 4.3 revision 128980 generates: str.fppized.f90:337.29: module procedure create 1 Error: Ambiguous interfaces 'create' and 'create' in generic interface 'create_' at (1) str.fppized.f90:337.29: Revision 128885 is OK.
[hjl@gnu-23 build_base_o2.0000]$ cat bar.f90 module BAR_MODULE implicit none private public create_ interface create_ module procedure create end interface contains subroutine create(self) character(*) :: self pointer :: self allocate(self) end subroutine end [hjl@gnu-23 build_base_o2.0000]$ /usr/gcc-4.3/bin/gfortran -c bar.f90 [hjl@gnu-23 build_base_o2.0000]$ cat foo.f90 module FOO_MODULE use BAR_MODULE implicit none private public create_ interface create_ module procedure create end interface public create_copy_ interface create_copy_ module procedure create_copy end interface contains subroutine create(self) character(*) :: self pointer :: self nullify(self) allocate(self) self = " " end subroutine subroutine create_copy(self,s) character(*) :: self pointer :: self character(*) :: s call create_(self) end subroutine end [hjl@gnu-23 build_base_o2.0000]$ /usr/gcc-4.3/bin/gfortran -c foo.f90 foo.f90:7.29: module procedure create 1 Error: Ambiguous interfaces 'create' and 'create' in generic interface 'create_' at (1) foo.f90:7.29: module procedure create 1 Warning: Ambiguous interfaces 'create' and 'create' in generic interface 'create_' at (1) [hjl@gnu-23 build_base_o2.0000]$
It should be: [hjl@gnu-27 pr33646]$ cat bar.f90 module BAR_MODULE implicit none private public create_ interface create_ module procedure create end interface type system_type integer(kind=kind(1)) :: max_memory_used end type contains subroutine create(self) type(system_type) :: self pointer :: self allocate(self) end subroutine end [hjl@gnu-27 pr33646]$ cat bar.f90 module BAR_MODULE implicit none private public create_ interface create_ module procedure create end interface type system_type integer(kind=kind(1)) :: max_memory_used end type contains subroutine create(self) type(system_type) :: self pointer :: self allocate(self) end subroutine end [hjl@gnu-27 pr33646]$ make gfortran -c bar.f90 gfortran -c foo.f90 foo.f90:7.29: module procedure create 1 Error: Ambiguous interfaces 'create' and 'create' in generic interface 'create_' at (1) foo.f90:7.29: module procedure create 1 Warning: Ambiguous interfaces 'create' and 'create' in generic interface 'create _' at (1) make[1]: *** [foo.o] Error 1
hj, It's me - I'll revert the patch that did this, right away. Cheers Paul
> It's me I have warned you;-)
Revision 128954: http://gcc.gnu.org/ml/gcc-cvs/2007-10/msg00058.html is the cause.
It's reverted - sorry HJ. Paul
Subject: Bug 33646 Author: hjl Date: Thu Oct 4 13:42:48 2007 New Revision: 129008 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129008 Log: Mention PR fortran/33646 in revision 129000. Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/testsuite/ChangeLog
Subject: Bug 33646 Author: hjl Date: Thu Oct 4 15:39:11 2007 New Revision: 129015 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129015 Log: 2007-10-04 H.J. Lu <hongjiu.lu@intel.com> PR fortran/33646 * gfortran.dg/pr33646.f90: New file. Added: trunk/gcc/testsuite/gfortran.dg/pr33646.f90 Modified: trunk/gcc/testsuite/ChangeLog