(j3.2006) Comment 2 from TS Ballot

Bader, Reinhold Reinhold.Bader
Mon Sep 10 16:44:29 EDT 2012


How about

"If a formal parameter of type CFI_cdesc_t * corresponds to a dummy
argument in an interoperable procedure interface, indirection on a
pointer derived from its base_addr member by pointer arithmetic valid
in C is allowed if and only if the value of that pointer can be obtained 
by applying the function CFI_address (8.3.5.2) to the object or a subobject of it."
?

This makes it more clear that C pointer arithmetic underlies additional 
restrictions when operating on objects coming in from Fortran. I've also
turned CFI_cdesc_t into a pointer type since that appears more appropriate.

Regards
Reinhold

> -----Urspr?ngliche Nachricht-----
> Von: j3-bounces at mailman.j3-fortran.org [mailto:j3-bounces at mailman.j3-
> fortran.org] Im Auftrag von Bill Long
> Gesendet: Montag, 10. September 2012 22:28
> An: fortran standards email list for J3
> Betreff: (j3.2006) Comment 2 from TS Ballot
> 
> The ISO ballot on the DTS for TS 29133 (Interoperability TS) resulted
> in a total of two comments, both technical and from Germany. We
> need to create a document containing responses to these comments.
> 
> The following starts the discussion of the second comment. Please,
> especially Reinhold, post to the list if you think I have misunderstood
> the intent of the comment.
> 
> 
> -------From the Ballot Response for Comment 2-----------------
> 
> Technical comment 1 from Germany:
> 
> For an entity of [a pointer to] type CFI_cdesc_t that corresponds to a
> non-contiguous Fortran object, accessing parts of the object that would
> not be accessible in Fortran must be explicitly disallowed, because the
> base_addr member is exposed.
> 
> Proposed change:
> 
> In 8.5, after para 3, add a para 4:
> "If a formal parameter of type CFI_cdesc_t corresponds to a dummy
> argument in an interoperable procedure interface, indirection on a
> pointer calculated from its base_addr member is allowed if and only if
> the value of that pointer can be obtained by applying the function
> CFI_address (8.3.5.2) to the object or a subobject of it."
> 
> 
> -------End of Ballot Response for Comment 2-------------------
> 
> Discussion:
> 
> I had thought that we had something similar to this in the TS in the
> past, but I'm not finding it now.    I'm concerned that  "calculated
> from" in the edit is sufficiently vague that the paragraph is not really
> a solution to the problem.   The real objective is to permit access to
> only elements of the actual argument corresponding to the dummy argument
> in the interoperable procedure interface.    Maybe:
> 
> "If a formal parameter that is a pointer to CFI_cdesc_t corresponds to a
> dummy argument in an interoperable interface, a computed pointer may be
> used to access the corresponding actual argument, or a subobject of it,
>   if and only if the value of the computed pointer can be obtained by
> applying the function CFI_address (8.3.5.2) to the formal parameter."
> 
> Comments...
> 
> 
> Cheers,
> Bill
> 
> 
> --
> Bill Long                                           longb at cray.com
> Fortran Technical Support    &                 voice: 651-605-9024
> Bioinformatics Software Development            fax:   651-605-9142
> Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101
> 
> 
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3



More information about the J3 mailing list