To: J3 11-244r1 From: John Reid Subject: GB 37-39: edits to PDTR 29113 Date: 2011 October 11 Reference: WG5/N1869, WG5/N1881 Discussion Comment GB37 says that a BIND(C) routine should be prohibited from having a CONTIGUOUS POINTER dummy argument. This is addressed by the first edit below. Comment GB38 says that the passing of a discontiguous array section from a C routine to a contiguous assumed-shape array dummy argument should be explicitly stated to be permitted. Comment GB39 says that it should be explicitly stated that a C routine whose Fortran interface has a CONTIGUOUS assumed-shape array dummy must be prepared to handle a discontiguous actual argument itself. Comments GB38 and GB39 are addressed by the second edit below. The assumed-rank case is included. GB39 provoked much discussion in subgroup. The alternative is to say that a C routine calling a procedure with a CONTIGUOUS assumed-shape array dummy must make sure that the actual array is contiguous. This version was favoured 4-2-1 in a straw vote. Alternative edits are provided for this. Edits to WG5/N1869 In 5.3.8, paragraph 3 bullet item (6) (c), after "or a pointer" insert "without the CONTIGUOUS attribute". In 5.3.8, before the final paragraph, add paragraph "In an invocation of an interoperable procedure whose Fortran interface has an assumed-shape or assumed-rank dummy argument with the CONTIGUOUS attribute, the actual argument may be an array that is not contiguous or the address of a C descriptor for such an array. If the invoked procedure is a Fortran procedure, the processor will handle this. If the invoked procedure is a C function, the C code within the procedure shall construct a contiguous copy." In 6.9, edits for 15.3.7, para 2, item (5)(c), after "or a pointer" insert "without the CONTIGUOUS attribute". In 6.9, edits for 15.3.7, inserting new paragraphs at the end of the subclause, after para "If a dummy", add paragraph "In an invocation of an interoperable procedure whose Fortran interface has an assumed-shape or assumed-rank dummy argument with the CONTIGUOUS attribute, the actual argument may be an array that is not contiguous or the address of a C descriptor for such an array. If the invoked procedure is a Fortran procedure, the processor will handle this. If the invoked procedure is a C function, the C code within the procedure shall construct a contiguous copy." Alternative paragraph: "In a Fortran invocation of an interoperable procedure whose Fortran interface has an assumed-shape or assumed-rank dummy argument with the CONTIGUOUS attribute, the actual argument may be an array that is not contiguous. In a C invocation of such a procedure, the invoking C code shall ensure that the actual argument is contiguous."