To: J3 J3/19-183r2 From: Daniel Chen & Malcolm Cohen Subject: Clarification of global identifier Date: 2019-August-06 1. Introduction Some of the text describing global identifiers and global entities can be misunderstood. However, the text is not actually incorrect. A possible change is suggested to make it less easy to misunderstand. 2. The example and the misunderstanding Consider the obviously-correct source code: module m1 interface subroutine sub1() bind(c, name="samec") end end interface end module m2 interface subroutine sub2() bind(c, name="samec") end end interface end Since Fortran 2008, further clarified by interp F08/0139, SUB1 and SUB2 are local identifiers, not global identifiers. According to F2018 [497: 26-27] 19.2 Global identifier, "A binding label of an entity of the program is a global identifier." and therefore the entities SUB1 and SUB2 would appear to both have the global identifier "samec". If so, the source code would appear to violate [497:28] "The global identifier of an entity shall not be the same as the global identifier of any other entity". 3. Why the misunderstanding is wrong The local entities SUB1 and SUB2 are interfaces, and the global identifier "samec" is part of those interfaces... HOWEVER, "samec" does not *identify* SUB1 or SUB2. That is, both SUB1 and SUB2 describe the external procedure with the global identifier "samec", but the identifiers of those interfaces are the local identifiers SUB1 and SUB2. 4. A possible clarification (edit to 18-007r1) The misunderstanding at the end of section 2 could be clarified by making it clear that the restriction applies only to global entities. [497:28] 19.2 Global identifier, p1, first sentence, Change "an entity" to "a global entity", change "any other entity" to "any other global entity". Thus making the sentence read: "The global identifier of a global entity shall not be the same as the global identifier of any other global entity." This clarification is not strictly necessary: SUB1 and SUB2 *declare* the external procedure that has the global identifier "samec"; they do not themselves *have* the global identifier "samec". i.e. the confusion is between the (local) interface and the procedure it describes. Straw Vote: Make the edit? (Y/N/U) ===END===