J3/06-202 Date: July 23, 2006 To: J3 From: Aleksandar Donev Subject: BIND(C) for internal procedures References: J3/06-143, Resubmit of J3/06-160 Note: I am not certain to what J3/06-160 was discussed already at meeting 176, however, I consider it integration material and am resubmitting it again for consideration by Interop. Discussion: __________ Recently we allowed internal procedures to be passed as actual arguments or to be the targets of procedure pointers. Integration demands that this be extended to work with C Interop, that is, a should be allowed for internal procedures, and also such procedures should be allowed as actual arguments to C_FUNLOC. We should not allow binding labels for internal procedures since the host environment of the internal procedure (required in order to execute it) is not established until runtime (and thus not known to the linker). There are two options for achieving this: 1) Require that BIND(C,NAME="") be specified, i.e., no binding label be requested explicitly, or 2) Do not allow a NAME= specifier and explain that there is no binding label for internal procedures. I give the edits here for both options. I vote for option 1 myself, since I would like to have the "no NAME= specifier" constraint apply only to INTERFACE blocks, and not to real procedures. This is similar to how we require NAME="" to be specified for PRIVATE module procedures, instead of saying they have no binding label. Edits: __________ Note that no edits are needed for C_FUNLOC: Once we allow internal procedures to be interoperable, they can be actual arguments to C_FUNLOC. Option 1: [279:30] Replace constraint C1237 (R1225) with C1237 (R1225) If a is specified for an internal procedure, the NAME= specifier shall appear and it shall specify that the procedure has no binding label (15.4.1). Option 2: [279:30] Delete constraint C1237 (R1225) [279:27] In the constraint C1236 (R1225) replace "of an interface body" with "of an internal procedure or of an interface body" [403:36] Replace: "the procedure is not a dummy procedure or procedure pointer" with "the procedure is not a dummy procedure, an internal procedure, or a procedure pointer"