Hi,
I don't know about "required", but here's what I find on several
systems:
SGI:
f90-487 f90: ERROR A, File = interface.f90, Line = 4, Column = 22
The specific interfaces for "GETNEXT_B" and "GETNEXT_A" make the GENERIC interface "GETNEXT" ambiguous.
HP:
Error 396 at (5:interface.f90) : Generic procedure GETNEXT has ambiguous specific procedures GETNEXT_A and GETNEXT_B
TRU64:
(Not caught)
Linux-x86/Absoft:
cf90-487 f90fe: ERROR A, File = interface.f90, Line = 4, Column = 22
The specific interfaces for "GETNEXT_B" and "GETNEXT_A" make the GENERIC interface "GETNEXT" ambiguous.
AIX:
"interface.f", line 4.22: 1514-165 (S) Procedure "getnext_b" must have a nonoptional dummy argument that corresponds by position in the argument list to a dummy argument not present in procedure "getnext_a", present with a different type, or present with a different rank.
Summary:
Of these five, only TRU64 fails to catch the bug. My Sun is down
for administration at the moment, so I can't tell you what would
happen there.
(These are all "fairly recent" compilers.)
-P.
On Mon, 17 Jul 2000, 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
>
--
--
** Whether the playing field is level depends on the coordinate system. ***
********* Peter S. Shenkin; Schrodinger, Inc.; (201)433-2014 x111 *********
*********** [log in to unmask]; http://www.schrodinger.com ***********
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|