To: J3 J3/18-210r2 From: Bill Long & Daniel Chen & Malcolm Cohen Subject: Ballot Comment GB056 Date: 2018-June-14 Ballot Comment -------------- In their DIS Ballot for draft N2146 of Fortran 2018, the GB comment 056 reads: "The term "simply contiguous dummy variable" is undefined. Moreover as described in NOTE 18.22 it is inconsistent with the current standard." with the suggested edits: In paragraph 5 change "simply contiguous dummy argument" to "dummy argument which has the CONTIGUOUS attribute, or is an assumed-length CHARACTER array and not a pointer, assumed-shape, or assumed-rank,". Make the same change in paragraph 6. Delete paragraph 7. Delete NOTE 18.22 Add a new NOTE 18.22: "If an interoperable C procedure whose Fortran interface has a dummy argument which has the CONTIGUOUS attribute, or is an assumed-length CHARACTER array and not a pointer, assumed-shape, or assumed-rank, is invoked from C, the invoking routine is responsible for the contents of the C descriptor which therefore might not describe a contiguous data object." Discussion ---------- Subgroup in principle agrees with the comment. We also modified the edit as: 1. "simply contiguous dummy argument" could be replaced by "dummy argument whose designator would be simply contiguous". However, this obscures the fact that it is only a couple of cases that are affected, viz "CONTIGUOUS attribute or assumed-length CHARACTER array that is explicit-shape or assumed-size". OTOH that is rather a mouthful in a long sentence. 2. An interoperable assumed-length CHARACTER array cannot be allocatable or pointer; An interoperable CHARACTER array that is allocatable or pointer must have deferred length, so we removed the "a pointer, ". Edit to N2146 ------------- Page 490, 18.3.7 Interoperability of procedures and procedure interfaces, para5, After "When an interoperable Fortran procedure" change "with a simply contiguous dummy argument" to "that", After "is invoked from C" insert "has a dummy argument with the CONTIGUOUS attribute or that is an assumed-length CHARACTER explicit-shape or assumed-size array," making the paragraph read "When an interoperable Fortran procedure that is invoked from C has a dummy argument with the CONTIGUOUS attribute or that is an assumed- length CHARACTER explicit-shape or assumed-size array, and the actual argument is the address of a C descriptor for a discontiguous object, the Fortran processor shall handle the difference in contiguity." {The non-alternative is more concise but more grammatically intense, while the alternative is more verbose but also more comprehensible?} Paragraph 6, After "When an interoperable C procedure whose Fortran interface has a" change "simply contiguous dummy argument" to "dummy argument with the CONTIGUOUS attribute or that is an assumed- length CHARACTER explicit-shape or assumed-size array" making the paragraph read: "When an interoperable C procedure whose Fortran interface has a dummy argument with the CONTIGUOUS attribute or that is an assumed-length CHARACTER explicit-shape or assumed-size array is invoked from Fortran and the effective argument is discontiguous, the Fortran processor shall ensure that the C procedure receives a descriptor for a contiguous object." Delete paragraph 7 "When... handle the discontiguous argument.". Delete NOTE 18.22 "The requirements on the Fortran... or a pointer.". Add a new NOTE 18.22: "If an interoperable C procedure whose Fortran interface has a dummy argument which has the CONTIGUOUS attribute, or is an assumed-length CHARACTER explicit-shape or assumed-size array, is invoked from C, because the invoking routine is responsible for the contents of the C descriptor, it therefore might not describe a contiguous data object." ===END===