09-215 To: J3 From: Van Snyder Subject: Binding labels, linkage association Date: 2009 April 30 References: 09-007r1 1. Discussion 15.4.1 gives conditions under which a variable or common block with a binding label interoperates with a C global variable. The conditions for linkage association (external linkage, having a binding label) shouldn't be conflated with the conditions for interoperability. They belong in 16.5.1.5. The first sentence of 15.4.1p2 belongs in 16.5.1.5. There's nothing similar (in 15.4.1 anyway) for common blocks. Actually, it's impossible, but if we must say it, we should say it in 16.5.1.5. The first sentence of 15.4.1p3 (concerning binding labels for common blocks) belongs in 5.3.5 or 15.4.2. It has nothing to do with interoperability. There's a typo in 15.4.1p3 (an extraneous full stop at the end).. The condition for linkage association, i.e., that the name of the C variable has external linkage and is the same as a binding label, is specified in 15.4.2. This should be in 16.5.1.5. 2. Edits Curly brackets imply hyperlinks. [439:3-4 15.4.1p1]------------------------------------------------------ Editor: Insert "{linkage-associated} (16.5.1.5)" before "common block" and "{linkage-associated}" before "variable". Delete the second sentence of 15.4.1p1, viz. "The common block ... attribute." because that's in 16.5.1.5. [439:5 15.4.1p2]-------------------------------------------------------- Editor: Delete 15.4.1p2 because it has nothing to do with interoperability. See edits below for 16.5.1.5p1+. [439:9-10 15.4.1p3]----------------------------------------------------- Editor: Replace "whose name ... statement." with "a {common block}" so as not to conflate linkage association and interoperability, taking care to delete the extraneous full stop [439:14 15.4.1p4]------------------------------------------------------- Editor: Replace "an associated" with "a {linkage-associated}" and make the paragraph a note. [440:4 15.4.2p2+]------------------------------------------------------- Editor: Insert "(5.3.5)" after "attribute". [440:8+ 15.4.2p2+]------------------------------------------------------ Editor: Move the first sentence of 15.4.1p3 from [439:8-9] to here as a new paragraph. [440:9-11 15.4.2p3]----------------------------------------------------- All the conditions for linkage association belong in 16.5.1.5. They shouldn't be split between here and there. Editor: Replace the paragraph: "A {common block} or variable with a {binding label} may be {linkage associated} (16.5.1.5) with a C variable whose name has external linkage." [450:3 16.5.1.5p1]------------------------------------------------------ Editor: Before the full stop insert ", if the name of the C variable has external linkage as defined by 6.2.2 of the C International Standard and the name is the same as the {binding label} (15.4.2) of the Fortran entity". [The phrase "as defined by 6.2.2 of the C International Standard" already appears in 15.1p1, but it seems to be important -- maybe necessary -- here, while it's introductory waffle there.] [450:34+ 16.5.1.5p1+]--------------------------------------------------- Editor: Insert a note and a paragraph: "NOTE 6.10a Because all declarations of a C variable with a given name and external linkage refer to the same entity, it is impossible for a Fortran variable or common block to be linkage associated with more than one C variable. Because binding labels are global identifiers and two Fortran entities cannot have the same global identifier (16.2), it is impossible for a C variable to be linkage associated with more than one Fortran data entity." "A linkage-associated variable shall not be initially defined by more than one processor." [This is about linkage association, not about interoperability, so it belongs here, not in 15.4.1p2.]