J3/99-262r2 Date: 1999/12/3 To: J3 From: /interop Subject: Issues 86 and 203 (constraints on BIND(C)) Edits and references refer to J3/99-007R2 Issue 86 [42: 1-10] Issue 203 [42:18-21] 1. Issue 86 Issue 86 asks why the combination of SEQUENCE and BIND(C) in the definition of a derived type is prohibited. The reason is that the requirements of BIND(C) and the requirements of SEQUENCE with respect to storage could be in conflict. We want however to retain the functionality given by the SEQUENCE property of having data entities declared in different scoping units with reference to different derived-type definition with the same name, to be the same. This functionality is retained by giving it to the BIND attribute. Edits: [42:1-10] Delete J3 note [54:29] Change "have the SEQUENCE property," to "all have the SEQUENCE property or all have the BIND(C) attribute," [54:32] After "the SEQUENCE property" insert "or with the BIND(C) attribute" [75:22+] Add J3 note /begin J3 note/ The previous paragraph has to be changed, following the addition of the 'BIND(C) attribute' edit to (4.5.2). As the paragraph stands, it does not allow data entities with the BIND(C) attribute, which are declared in different scoping units with reference to different derived-type definition with the same name, to be the same. Thus the paragraph has either to be fixed, or deleted. /end J3 note/ 2. Issue 203 Issue 203 asks why procedure pointers are prohibited from having the BIND(C) attribute. The reason is that the design of C-Fortran interoperability does not allow the interoperation of Fortran and C pointers. Note that the passing of a C-pointer to a procedure from Fortran to C is possible through the use of the C_LOC intrinsic function, with as argument a procedure with a BIND(C) attribute. This note is added as edit to the section on procedure pointers (12.3.2.3). Edits: [42:17-21] Delete J3 note [272:17+] Add note and renumber notes: /begin standard note/ A procedure pointer can not interoperate with a C pointer. However, it is possible to pass a C pointer to a procedure from Fortran to C through the use of the C_LOC function, accessible from the ISO_C_BINDING module. The argument of the C_LOC function is then a procedure with a BIND(C) attribute. /end standard note/