J3/17-214 To: J3 From: John Reid & Reinhold Bader Subject: Comments 68, 69, and 71 Date: 2017 October 07 Discussion: ----------- Comments 68, 69, and 71 consider assumed-size arrays in three subclauses of 18: 1. For CFI_select_part, comment 68 says that the source parameter should not be allowed to be a C descriptor for an assumed-size array. We have not found a direct prohibition against constructing an array section by component selection on an assumed-size array, but [137:7-8] says "In an with no , the rank and shape of the array is the rank and shape of the with nonzero rank". This implies that the must have a shape, which means that it cannot be an assumed-size array. If it were allowed, what could you do with it? It can't be used in an assignment because it has no shape. It can't be used as an actual argument corresponding to an assumed-size dummy argument because it is not contiguous so copy-in copy-out would be needed but the shape is unknown. 2. For CFI_setpointer, comment 69 says that the source parameter should not be allowed to be a C descriptor for an assumed-size array, because Fortran pointer assignment requires that the target have a shape. This function is intended to give the C programmer the equivalent of pointer assignment in Fortran. It is actually giving the C programmer slightly more. We support the change but it might be argued that none is needed. 3. An assumed-shape dummy argument cannot be associated with an assumed-size actual argument. [318:28-29] states this for Fortran, but it may be appropriate to reiterate this for C. If it is decided that no normative text is needed, the edit could be reworded as a NOTE, adding a reference to subclause 15.5.2.4. Edits to 17-007r2: --------------- [505:41-42] In 18.5.5.8 The CFI_select_part function, para 2, source, change "for a nonallocatable nonpointer array, an allocated allocatable array, or an associated array pointer" to "for an allocated allocatable array, an associated array pointer, or a nonallocatable nonpointer array that is not an assumed-shape array". [506:35] In 18.5.5.9 The CFI_setpointer function, para 2, source, change "for a nonallocatable nonpointer data object, an allocated allocatable object, or a data pointer object" to "for an allocated allocatable object, a data pointer object, or a nonallocatable nonpointer data object that is not assumed-size". [507:24+] In 18.6 Restrictions on C descriptors, end of para 2, add a new paragraph: "If the address of a C descriptor is a C actual argument that corresponds to an assumed-shape Fortran dummy argument, that descriptor shall not be for an assumed-size array."