[J3] Question about C_F_Pointer

Vipul Parekh parekhvs at gmail.com
Tue May 4 00:38:10 UTC 2021


On Mon, May 3, 2021 at 5:29 PM Van Snyder via J3 <j3 at mailman.j3-fortran.org>
wrote:

> ..
> Using TYPE(*) requires either a pointer or a SELECT TYPE construct. ..
>

The standard appears clear on what is an interoperable type; a data type
that doesn't match with that can be seen as non-interoperable.

With a non-interoperable type, what the standard effectively only permits a
"void pointer" (void *) to the address of an object of such type as a
formal parameter in C functions interoperating with the Fortran processor.
This can be TYPE(C_PTR) typically generated using C_LOC and passed around
with INTENT(IN) and VALUE.  The original post was complaining about this,
and also with C_FUNLOC.   I believe the example I gave with TYPE(*) and
PROCEDURE statement addressed both the issues.  What the reply is raising
now makes no sense whatsoever to me vis-a-vis anything I see in the
"interoperability with C" section in the Fortran standard or with the C
standard or the companion C processors at hand.

Vipul Parekh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20210503/01d0d535/attachment.htm>


More information about the J3 mailing list