(j3.2006) Fw: (SC22WG5.3591) Assumed-type and Assumed-rank extensions for C Interop TR.
Jim Xia
jimxia
Fri Jul 25 15:20:23 EDT 2008
I intented to send it to the whole group.
Jim Xia
RL Fortran Compiler Test
IBM Toronto Lab at 8200 Warden Ave, Markham, On, L6G 1C7
Phone (905) 413-3444 Tie-line 313-3444
email: jimxia at ca.ibm.com
D2/YF7/8200 /MKM
----- Forwarded by Jim Xia/Toronto/IBM on 07/25/2008 03:19 PM -----
Jim Xia/Toronto/IBM
07/25/2008 02:59 PM
To
longb at cray.com
cc
Subject
Re: (j3.2006) (SC22WG5.3591) Assumed-type and Assumed-rank extensions for
C Interop TR.
Bill Long <longb at cray.com> wrote on 07/25/2008 02:38:50 PM:
> > The basic problem is Fortran side can not use this type directly. If
> > the procedure is defined in Fortran for C, then how can a Fortran
> > programmer "map" this dummy argument to real Fortran data type.
>
> In what way does C_F_POINTER fail to solve this problem? It was
> explicitly designed to be used on the Fortran side to give a Fortran
> type, type parameters, and shape to a block of memory pointed to by a C
> address.
Read what's written in C_F_POINTER on page 394
(1) If the value of CPTR is the C address of an interoperable data
entity, FPTR shall be a data pointer with type and type parameters
interoperable with the type of the entity. In this case, FPTR
becomes pointer associated with the target of CPTR. If FPTR is
an array, its shape is specified by SHAPE and each lower bound
(2) If the value of CPTR is the result of a reference to C LOC with a
noninteroperable argument X, FPTR shall be a nonpolymorphic
scalar pointer with the same type and type parameters as X. In
this case, X or its target if it is a pointer shall not have been
deallocated or have become undefined due to execution of a RETURN
or END statement since the reference. FPTR becomes
pointer associated with X or its target.
In any case, it is asking for the pointer association. I don't see how
TYPE(*) can fit in here yet.
Cheers,
Jim Xia
RL Fortran Compiler Test
IBM Toronto Lab at 8200 Warden Ave, Markham, On, L6G 1C7
Phone (905) 413-3444 Tie-line 313-3444
email: jimxia at ca.ibm.com
D2/YF7/8200 /MKM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://j3-fortran.org/pipermail/j3/attachments/20080725/d16e5788/attachment-0001.html
More information about the J3
mailing list