(j3.2006) Generic interface question
Van Snyder
van.snyder
Sat Mar 5 04:00:30 EST 2011
malcolm at nag-j.co.jp wrote:
>> The following generic interface appears to be standard conforming:
>>
>
> No it doesn't.
>
>
>> interface Generic
>> subroutine S ( A ) bind(C,'x')
>> real :: A
>> end subroutine S
>> subroutine T ( B, C ) bind(C,'x')
>> integer :: A, B
>> end subroutine T
>> end interface
>>
>> The rules in 12.4.3.4.5
>>
>
> have nothing to do with it.
>
> You have two entities with the same global identifier (the binding label), breaking the fundamental rule of global identifiers:
>
> "The global identifier of an entity shall not be the same as the
> global identifier of any other entity."
>
Yeah, that's 16.2p2. If the interface bodies were in different
interface blocks in different scoping units, presumably they would be
acceptable. At least that was the objective when we did the
hair-splitting in 16.3.1p1 to make the names of external procedures that
have binding labels local identifiers. How about if they're in the same
scoping unit, but not in generic interfaces that have the same
<generic-spec>, say in two abstract interface blocks (or even the same
abstract interface block)?
An interface body with a binding label is a global entity, according to
16.2p1. So did we accomplish our objective to allow an external
procedure with a particular binding label to have more than one local
name? 16.2p1 and 16.2p2 appear to say we didn't.
> Cheers,
>
More information about the J3
mailing list