To: J3 J3/19-194r1 From: Daniel Chen Subject: C_F_POINTER modification for feature UK-01 Date: 2019-August-05 Reference: WG5/N2167, 18-007r1 Introduction ------------ UK feature for F202X in WG5/N2167: UK-01 A pointer assignment allows an array pointer to have lower bounds other than 1. Intrinsic subroutine C_F_POINTER does not. This paper proposes adding an optional argument to C_F_POINTER to allow that. Edits to 18-007r1 ---------------- [xiii] Introduction Add "The subroutine C_F_POINTER in the intrinsic module ISO_C_BINDING has an extra optional dummy argument, LOWER that specifies the lower bounds of FPTR." [470:13] Subclause 18.2.3.3 C_F_POINTER (CPTR, FPTR [, SHAPE]) replace "[, SHAPE]" by "[, SHAPE, LOWER]" The line now reads: 18.2.3.3 C_F_POINTER (CPTR, FPTR [, SHAPE, LOWER]) [470:24-25] Subclause 18.2.3.3 C_F_POINTER (CPTR, FPTR [, SHAPE]) replace " and each lower bound is equal to 1." by "; the lower bounds are specified by LOWER if it is present, and otherwise are equal to 1." The line now reads: "If FPTR is an array, its shape is specified by SHAPE; the lower bounds are specified by LOWER if it is present, and otherwise are equal to 1." [471:21-22] Subclause 18.2.3.3 C_F_POINTER (CPTR, FPTR [, SHAPE]) In Case (iii), replace " and each lower bound is 1" to "; the lower bounds are specified by LOWER if it is present, and otherwise are equal to 1." The line now reads: "If FPTR is an array, its shape is specified by SHAPE; the lower bounds are specified by LOWER if it is present, and otherwise are equal to 1." [471:26+] Subclause 18.2.3.3 C_F_POINTER (CPTR, FPTR [, SHAPE]) After the definition of SHAPE, add: "LOWER (optional) shall be a rank-one integer array. It is an INTENT (IN) argument. It shall not be present if SHAPE is not present. If LOWER is present, its size shall be equal to the rank of FPTR." [471:37-45] Examples. replace Case (ii) by: " Type t Real, Allocatable :: v(:,:) End Type Type(t), Target :: x(0:2) Type(C_ptr) :: xloc xloc = C_Loc (x) ... Type(t), Pointer :: y (:) Call C_F_Pointer (xloc, y, [3], [0]) "