[MPI3 Fortran] Fwd: [Mpi-comments] MPI 3.0:Fortran 2008 interface - issue with the LOGICAL kind

Tobias Burnus burnus at net-b.de
Mon Mar 4 01:36:48 CST 2013


Malcolm Cohen wrote:
>>    (B1) Is it possible, that a BIND(C) routine
>>         has a dummy argument that is a non-BIND(C)
>>         ABSTRACT INTERFACE procedure argument?
>
> That is not possible: all dummy arguments of a BIND(C) routine must be 
> interoperable - for procedures that requires BIND(C).
>
> It would be reasonable to extend C_FUNLOC and C_F_PROCPOINTER to 
> permit non-interoperable procedures, similarly to how we permit 
> non-interoperable variables in C_LOC and C_F_POINTER.  Then the 
> argument could be C_FUNPTR (by value).  I don't know whether this 
> would help you though.

Regarding the last sentence, I also don't know whether it helps; it 
seems as if it requires the MPI user to call "c_funloc" and to disable 
argument checking. However, I believe the restriction you mention is 
gone with TS29113. Quoting its Section "8.1 Removed restrictions on 
ISO_C_BINDING":

"The function C_F_PROCPOINTER from the intrinsic module ISO_C_BINDING 
has the restriction in ISO/IEC 1539-1:2010 that CPTR and FPTR shall not 
be the C address and interface of a noninteroperable Fortran procedure"
[...]
"The function C_FUNLOC from the intrinsic module ISO_C_BINDING has the 
restriction in ISO/IEC 1539-1:2010 that its argument shall be interoperable.
"These restrictions are removed."

However, "9.9 Edits to clause 15" also states:
'Append the sentence "A C function shall not invoke a a function pointer 
whose value is the result of a reference to C_FUNLOC with a 
noninteroperable argument.".'


Tobias



More information about the mpiwg-fortran mailing list