J3/00-338R1 Date: 13 December, 2000 To: J3 From: Meadows, /interop Subject: Unresolved issues 218, 219, 238 Unresolved issue 218, page 400, asks whether a BIND(C) global variable must be defined by C or whether it can be defined by Fortran. It also asks for clarification of the linkage between the C variable and the Fortran variable. Finally, it asks for rewording of shall vs. may in Section 16.2.7 . Unresolved issue 219, page 401, talks about needing details about changes to the C variable affect the Fortran variable, and vice versa. Unresolved issue 238, p. 67, asks if we should remove the prohibition that BIND(C) variables cannot be initialized. Note that a similar constraint occurs on p. 85 (discussing the DATA statement). Subgroup believes that a global variable with the BIND(C) attribute should cause that variable to exist if there is no C definition of the variable. There are several cases: C program Fortran program Fortran status --------------- ----------------- ------------------- no definition no initialization initially undefined no definition initialization initially defined definition no initialization initially undefined definition initialization illegal initialization no initialization initially defined initialization initialization illegal The above table resolves the issue of ownership of a BIND variable, and of whether or not Fortran should allow the variable to be initialized. There is still the issue of how modifications to the C variable affect the Fortran variable. The concept of linkage association is introduced to resolve this issue. Edits: These edits remove the prohibition that Fortran may not define an initial value for a BIND object. [67:1-2] Delete "an object with the BIND attribute, an object in a named COMMON block that has the BIND attribute," [67:3-8] Delete unresolved issue 238 [85:29-30] Delete "an object with the BIND attribute, an object in a named COMMON block that has the BIND attribute," These edits add the concept of linkage association: [353:17] Substitute "five" for "four" [353:18] Substitute "linkage association and construct" for "and construct" [360:33+] Add a section 14.6.5 Linkage association Linkage association occurs between a module variable that has the BIND attribute and the C variable with which it interoperates, or between a Fortran common block and the C variable with which it interoperates (16.2.7). Such an association remains in effect throughout the execution of the program. These edits add a new means for a variable to become initially defined: [361:14] Delete "and" [361:15] substitute "and" for "." [361:15+] Add a new bullet item: (5) Variables with the BIND attribute that are initialized by means other than Fortran. [361:15+] Add a note: Note 14.x Fortran code: module mod integer, bind(c,name="blivet") :: foo end module mod C code: int blivet = 123; In the above example, the Fortran variable foo is initially defined to the value 123 by means other than Fortran. *** END Note 14.x *** These edits resolve the issues about who "owns" a BIND variable. [392:33] Add the sentences: There does not have to be an associated C entity for a Fortran entity with the BIND attribute. [400:35-44] Delete unresolved issue 218 [400:32] Change "shall be" to "is" [400:34+] Add the sentence: A variable may be initially defined by at most one processor. [401:35-40] Delete unresolved issue 219.