08-226r1 To: J3 From: Van Snyder, originally Michael Ingrassia Subject: Public Comment J32012 Date: 2008 August 11 ---------------------------------------------------------------------- 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: Although F has the EXTERNAL attribute, subclause 5.3.9 requires that a procedure used as an actual argument shall be declared to have the EXTERNAL attribute. Therefore the program is not standard conforming. The definition of "attribute" in 2.1.6 is not defective. The definition of attributes in 5.1 is not defective, but is incomplete. An edit is supplied to complete the definition. [08-007r2:5.1] Editor: At the end of the subclause insert a paragraph: "The name of an entity may have attributes that are not attributes of the entity in all contexts. These include accessibility attributes, and the ASYNCHRONOUS and VOLATILE attributes."