- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I've using generic overloaded type-bound procedures for multiple type/rank combinations, and getting a warning when I try to compile:
I've using generic overloaded type-bound procedures for multiple type/rank combinations, and getting a warning when I try to compile:
[fortran]module contain
implicit none
type container
contains
private
generic, public :: Broadcast => Broadcast_integer_0, Broadcast_integer_1, Broadcast_logical_0, Broadcast_logical_1
procedure :: Broadcast_integer_0
procedure :: Broadcast_integer_1
procedure :: Broadcast_logical_0
procedure :: Broadcast_logical_1
end type container
type(container) :: x
contains
subroutine Broadcast_integer_0 ( this, x, rank )
class(container), intent(in) :: this
integer, intent(inout) :: x
integer, optional, intent(in) :: rank
integer :: mpierror
write(*, *) "in logical_0"
end subroutine Broadcast_integer_0
subroutine Broadcast_integer_1 ( this, x, rank )
class(container), intent(in) :: this
integer, dimension(:), intent(inout) :: x
integer, optional, intent(in) :: rank
integer :: mpierror
write(*, *) "in integer_1"
end subroutine Broadcast_integer_1
subroutine Broadcast_logical_0 ( this, x, rank )
class(container), intent(in) :: this
logical, intent(inout) :: x
integer, optional, intent(in) :: rank
integer :: mpierror
write(*, *) "in logical_0"
end subroutine Broadcast_logical_0
subroutine Broadcast_logical_1 ( this, x, rank )
class(container), intent(in) :: this
logical, dimension(:), intent(inout) :: x
integer, optional, intent(in) :: rank
integer :: mpierror
write(*, *) "in logical_1"
end subroutine Broadcast_logical_1
end module contain
program test
use contain
implicit none
integer :: integer_scalar
logical :: logical_scalar
integer, dimension(10) :: integer_vector
logical, dimension(10) :: logical_vector
call x%Broadcast( integer_scalar )
call x%Broadcast( integer_vector )
call x%Broadcast( logical_scalar )
call x%Broadcast( logical_vector )
end program test[/fortran] When I compile it, I get the warning[plain]test.f90(43): warning #8449: The type/rank/keyword signature for this specific procedure matches another specific procedure that shares the same generic binding name. [BROADCAST_LOGICAL_1] subroutine Broadcast_logical_1 ( this, x, rank )[/plain]It still runs correctly, though, so it's not a major problem:
[plain]bmenadue@weyl ~/bmenadue/Code/variational_analysis/trunk/src/modules>./a.out a in logical_0 in integer_1 in logical_0 in logical_1[/plain]I'm just curious what's causing this.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
looks like an invalid warning. I'll start a bug report.
bug ID DPD200168113
ron
bug ID DPD200168113
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Cheers.
I've also discovered it does it for real, complex, and character types, along with logical, just not for integers.
Ben
I've also discovered it does it for real, complex, and character types, along with logical, just not for integers.
Ben
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've got that noted. Thanks Ben.
ron
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This error is fixed in the "Update 7" compiler, 12.1.1.246
thanks for sending this to us and helping to improve the compiler.
ron
thanks for sending this to us and helping to improve the compiler.
ron
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page