08-234r2 To: J3 From: Van Snyder, originally Michael Ingrassia Subject: Public Comment J32020 Date: 2008 August 13 ---------------------------------------------------------------------- Commenter: Robert Corbett Subject: "constraint C538" Constraint C538 in Section 5.3.9 introduces an incompatibility with Fortran 2003 that is not described in Section 1.5 of the Fortran 2008 draft. The Fortran 90 standard required the name of an external procedure used as an actual argument to be declared in an EXTERNAL statement or in an interface block. Because the name of an external procedure could not appear in an interface block in the subprogram in which it is defined, that effectively required the name to appear in an EXTERNAL statement if it was passed as an argument. What once was required now is prohibited. I suggest adding a mention of constraint C538 to the list of incompatibilities in Section 1.5.2. ---------------------------------------------------------------------- J3 response: C538 repeats a requirement from 04-007 (Fortran 2003) subclause 12.3.2.2. It was made a constraint in 06-007r1. There is no incompatibility with Fortran 2003. This requirement did not appear in subclause 12.3.2.2 in Fortran 95. Instead, subclause 12.3.2.2 of Fortran 95 required that a procedure that is used as an actual argument shall either have explicit interface or be explicitly declared to have the EXTERNAL attribute. In Fortran 95, an external procedure has explicit interface within its own body if it is recursive. Therefore, it was not required to specify a procedure to have the EXTERNAL attribute, within its own body, if it is used as an actual argument. If it is not recursive, it does not have explicit interface, but there was no point in passing it as an actual argument, since it could not be executed, and until Fortran 2008 it could not be a pointer target, so there was no need to specify explicitly that it had the EXTERNAL attribute. In Fortran 2008, all procedures have explicit interface within the subprograms that define them (12.4.2.1p1). It was not clear in Fortran 95 whether a recursive procedure name could be explicitly given the EXTERNAL attribute within its own body. If there was an incompatibility between Fortran 95 and Fortran 2003, the correct mechanism to correct it or announce it is a corrigendum.