To: J3 11-244r2 From: John Reid Subject: GB 37-39: edits to PDTR 29113 Date: 2011 October 12 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. J3 decided that it is desirable for the Fortran processor to handle this situation if either the caller or the callee is Fortran. A precedent has been set for deallocating an allocatable array with intent(out) on entry to a procedure. 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 corresponding actual argument may be an array that is not contiguous or the address of a C descriptor for such an array. If the procedure is invoked from Fortran or the procedure is a Fortran procedure, the Fortran processor will handle the difference in contiguity. If the procedure is invoked from C and the procedure is a C procedure, the C code within the procedure shall be prepared to handle the situation of receiving a discontiguous argument." 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 corresponding actual argument may be an array that is not contiguous or the address of a C descriptor for such an array. If the procedure is invoked from Fortran or the procedure is a Fortran procedure, the Fortran processor will handle the difference in contiguity. If the procedure is invoked from C and the procedure is a C procedure, the C code within the procedure shall be prepared to handle the situation of receiving a discontiguous argument."