08-235r1 To: J3 From: Van Snyder, originally from Michael Ingrassia Subject: Public Comment J32021 Date: 2008 August 13 ---------------------------------------------------------------------- Commenter: Robert Corbett Subject: "Allow compatible specific interfaces" Constraint C1201 in Section 12.4.3.2 of the Fortran 2008 draft is detested by many users. That constraint should be eliminated. The standard already requires that the characteristics specified by the interface body must match those of the subprogram definition (see paragraph 7 of Section 12.4.3.2). That requirement should be elevated to a constraint for this specific case. Constraint C1201 might be replaced with c1201 (R1201) If an interface block contains an interface-body for a procedure defined by that subprogram, the characteristics of the specific interface defined by the interface-body shall be consistent with those specified in the procedure definition except that the interface may specify a procedure that is not pure if the procedure is defined to be pure. Some users write modules containing interface blocks describing the external procedure used in their program. They then use that module in all the external subroutines and functions in their program. Most of them have by now learned to use renaming to avoid problems with constraint C1201, but they don't like it. They would like the information from the interface block created for a procedure to be visible and used for checking in the subprogram that defines that procedure. ---------------------------------------------------------------------- J3 response: J3 agrees this a useful feature. The proposed constraint is not, on its own, adequate. J3 has identified some editorial changes that would be necessary to implement this feature (shown below), but J3 is not confident that all necessary changes have been identified, or that the changes suggested below are correct. Therefore, J3 believes that this feature should be considered for a future revision of the standard. Since SUBROUTINE and FUNCTION are optional on END statements for module procedures in the current draft, a better solution for the illustrative problem the commenter presented is to create module procedures from external procedures by using INCLUDE lines. ---------------------------------------------------------------------- Proposed editorial changes. [5.3.1p1:C514] Editor: At the end of the constraint append ", except that the EXTERNAL attribute may be redundantly specified for an external procedure by an interface body within the subprogram that defines the procedure". [12.4.3.2:C1201] Editor: Within C1201 insert "that is not an external subprogram" after the first "subprogram". [12.4.3.2:C1201+] Editor: Insert a new constraint after C1201: "C1201+ (R1201) An interface body for a procedure defined by the external subprogram in which it appears shall specify the same characteristics for the procedure, shall specify the same names for corresponding dummy arguments, shall specify RECURSIVE if and only if the procedure is recursive, shall specify the same binding name if the procedure has a binding name, and shall not specify a binding name if the procedure does not have a binding name." [12.4.3.2p7] J3 is not sure what to do about the last sentence of this paragraph, or if there are other similar issues elsewhere.