(j3.2006) (SC22WG5.4792) Interop TS: ballot response

John Reid John.Reid
Fri Sep 21 04:20:32 EDT 2012


WG5,

Here is a draft response to the ballot comments from Germany (see N1938) 
and the corresponding changed Draft TS. The edits in N1941 have been 
discussed by J3. The whole response was constructed by Bill and has been 
checked by me and Reinhold. I would like now to open up the discussion 
to the whole of WG5. Is this response OK? Do you want another ballot? (I 
feel that I have been doing too many of these lately.)

Cheers,

John.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: N1942.pdf
Type: application/pdf
Size: 318885 bytes
Desc: not available
Url : http://mailman.j3-fortran.org/pipermail/j3/attachments/20120921/b0e185e2/attachment-0001.pdf 
-------------- next part --------------
                                  ISO/IEC JTC1/SC22/WG5 N1941

               Responses to the Comments in N1938

                     Bill Long, 19-Sep-2012


The SC22 ballot on N1917 as the draft for TS 29113 resulted in two
comments, as noted in N1938.  This paper addresses those comments and
documents the changes made to N1917 to create N1942.


Discussion for Comment 1
------------------------

Some characteristics of a dummy argument with the INTENT(OUT)
attribute result in actions as part of the procedure reference that
require the size of the dummy argument. Since the size and shape of an
assumed-size dummy argument are not generally known, those 
characteristics are disallowed for assumed-size arrays (C534 in ISO/IEC 
1539-1:2010). An assumed-rank dummy argument that is associated with an
assumed-size actual argument has the same limitation of unknown
size. A constraint similar to C534 is needed for an assumed-rank dummy
argument associated with an assumed-size actual argument, possibly
indirectly though intermediate assumed-rank arguments.


Discussion for Comment 2
------------------------

Suppose a C function is invoked from a Fortran procedure with an actual 
argument that corresponds to the address of a C descriptor in the C
prototype for that function.  The contents of the C descriptor
enable the C function to reference or define parts of the actual
argument. The assumption in the caller is that only those parts of the
actual argument will be accessed through the corresponding dummy
argument.  Accesses enabled through the C descriptor should not permit
access to memory in the caller other than that used for the associated
actual argument.  A paragraph imposing this restriction is needed.


Edits to N1917
--------------

In 5.2 Assumed-rank objects, and also at the end of 9.5 Edits to
clause 5, following constraint C535b in both subclauses, add a new
constraint:

"C535c If an assumed-size or nonallocatable nonpointer assumed-rank
array is an actual argument corresponding to a dummy argument that is
an INTENT(OUT) assumed-rank array, it shall not be polymorphic,
finalizable, of a type with an allocatable ultimate component, or of a
type for which default initialization is specified."

--------------------------------------------------

At the end of 8.5 Restrictions on formal parameters, add a new
paragraph:

"If a formal parameter that is a pointer to CFI_cdesc_t corresponds to
a dummy argument in an interoperable procedure interface, a pointer
based on the base_addr in that C descriptor shall not be used to
access memory that is not part of the object described by the C
descriptor."



More information about the J3 mailing list