I would think it should complain - I take it it doesn't?
Alvaro Fernandez
Charles Crawford wrote:
> The code below contains an interface ambiguity since the reference to
> GetNext could a call the GetNext_a with the optional argument or a call
> to GetNext_b without its optional arguement.. I think it violates the
> standard. Should a compiler be required to catch it?
>
> Chuck Crawford, Toronto
>
> module A
> interface GetNext
> module procedure GetNext_a
> module procedure GetNext_b
> end interface
>
> contains
> subroutine GetNext_a (S, N)
> character (10), intent(IN) :: S
> integer, optional, intent(OUT) :: N
> .....
> end subroutine GetNext_a
>
> subroutine GetNext_b (S, N, M)
> character (10), intent(IN) :: S
> integer, intent(OUT) :: N
> integer, optional, intent(OUT) :: M
> .....
> end subroutine GetNext_b
> end module A
>
> program Main
>
> character (10) :: SS
> integer :: K
>
> .....
>
> call GetNext (SS, K)
> .....
>
> end program
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|