Closed
Description
Consider the following code:
subroutine sub(arg)
character(*) :: arg(..)
interface
subroutine sub1(arg1) bind(c)
character(1) :: arg1(2,4)
end subroutine
end interface
call sub1(arg) ! Invalid
call sub2(arg) ! Invalid
contains
subroutine sub2(arg2)
character(*) :: arg2(10)
end subroutine sub2
end subroutine
Both calls to sub1
and sub2
are invalid based on c840
in the standard
[8.5.8.7]
C840 An assumed-rank variable name shall not appear in a designator or expression except as an actual argument that corresponds to a dummy argument that is assumed-rank, the argument of the function C_LOC or C_SIZEOF from the intrinsic module ISO_C_BINDING (18.2), the first dummy argument of an intrinsic inquiry function, or the selector of a SELECT RANK statement.
I don't see this can be a reasonable extension. Even it is, it seems not documented.