08-226r2 To: J3 From: Van Snyder, originally Michael Ingrassia Subject: Public Comment J32012 Date: 2008 August 13 ---------------------------------------------------------------------- Commenter: Robert Corbett Subject: "attributes" The Fortran 2008 draft states that attributes are properties of entities. That definition does not precisely cover all uses of attributes. Attributes are properties of names. The attributes of a name usually reflect properties of the entity named by the name, but not always. Consider the following program: REAL FUNCTION F() F = 1.0 END MODULE MOD EXTERNAL F REAL F END SUBROUTINE SUBR(F) EXTERNAL F END PROGRAM MAIN USE MOD, G => F X = F(X) CALL SUBR(F) ! not standard conforming CALL SUBR(G) END In the main program, the name F is known to be the name of an external function, but it does not have an explicit interface and it is not declared to have the EXTERNAL attribute. The name G is declared to have the EXTERNAL attribute, and so it can be used as an actual argument. Both F and G name the same function, but only G is declared to have the EXTERNAL attribute. Therefore, the EXTERNAL attribute must be a property of the name, not the function. The attributes ASYNCHRONOUS and VOLATILE also are attributes of names that do not specify properties of the entities names. ---------------------------------------------------------------------- J3 response: Since F is referenced as a function in the main program, it has the EXTERNAL attribute in that scoping unit. Subclause 12.5.2.9p4, as revised by paper 08-156r2 at meeting 184 simply requires that a procedure used as an actual argument has the EXTERNAL attribute. Therefore the program will be standard conforming. The definition of "attribute" in 2.1.6 is not defective. The definition of attributes in 5.1 is not defective, but could be clarified. An edit is supplied. [08-007r2:5.1] Editor: At the end of the subclause insert a paragraph: "Accessibility attributes apply to identifiers, not the entities they identify, and these attributes may be different in different scoping units. An entity may have the ASYNCHRONOUS or VOLATILE attributes in some scoping units and not have them in others."