(j3.2006) Public Comment J32012
Michael Ingrassia
michaeli
Tue Jul 8 20:22:39 EDT 2008
08-226
To: J3
From: Michael Ingrassia
Subject: Public Comment J32012
Date: 2008 July 08
----------------------------------------------------------------------
Commenter's Subject was "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.
----------------------------------------------------------------------
More information about the J3
mailing list