J3/01-156 Date: 3 March 2001 To: J3 From: John Reid Subject: Interpretation 21 (Restrictions on on END INTERFACE) Here are two draft answers for interp. 21. The key problem is deciding whether cases like INTERFACE OPERATOR (.NE.) ... END INTERFACE OPERATOR (/=) should be permitted. Either way, I found that quite a lot more words are needed in the standard to make the rules clear. The wording is based on that used for other constructors. I sent earlier drafts to the WG5 list for comments and would like thank those that helped me get to this version. .................................................. NUMBER: 000021 TITLE: Restrictions on on END INTERFACE KEYWORDS: INTERFACE block, END INTERFACE, generic procedures DEFECT TYPE: Erratum STATUS: J3 consideration in progress QUESTION: According to section 12.3.2.1 [194:18-20] The may be included in the only if it was provided in the and, if included, shall be identical to the in the . It is not clear what the words "shall be identical" were intended to mean. In particular, were they intended to merely convey the idea that the two s shall specify the same entity, even though such an entity might be represented in more than one way, or were they intended to convey something more restrictive? Are either of the following examples standard conforming programs? Example 1: PROGRAM P INTERFACE OPERATOR(.NE.) LOGICAL FUNCTION F(I, C) INTEGER, INTENT(IN) :: I CHARACTER(*), INTENT(IN) :: C END FUNCTION F END INTERFACE OPERATOR(/=) END PROGRAM P Example 2: MODULE MOD INTERFACE GEN SUBROUTINE SUB1(I) INTEGER :: I END SUBROUTINE SUB1 END INTERFACE END MODULE MOD PROGRAM P USE MOD, G1=>GEN, G2=>GEN INTERFACE G1 SUBROUTINE SUB2(L) LOGICAL :: L END SUBROUTINE SUB2 END INTERFACE G2 END PROGRAM P ANSWER: The intention is that the in the END INTERFACE statement should be obviously the same as that in the INTERFACE statement, both to the human reader and to the compiler. The words "shall be identical" signify that they must be lexically identical, that is, identical apart from layout changes permitted by the source form and the interpretation of the operators .LT., .LE.,.GT., .GE., .EQ., and .NE. as always being identical to <, <=, >, >=, ==, and /=. Example 1 conforms to the standard, but example 2 does not. Edits are provided to make this clear. EDITS: On page 194, subclause 12.3.2.1, in the fourth constraint following R1207 [194:19-20] delete 'and, if included, ... ' and add: If the includes , the interface-stmt> shall specify the same . If the includes ASSIGNMENT(=), the shall specify ASSIGNMENT(=). If the includes OPERATOR(), the shall specify the same . If one is .LT., .LE., .GT., .GE., .EQ., or .NE., the other is permitted to be the corresponding operator <, <=, >, >=, ==, or /=. ....................................................................... Alternative response ANSWER: The intention is that the in the END INTERFACE statement should be obviously the same as that in the INTERFACE statement, both to the human reader and to the compiler. The words "shall be identical" signify that they must be lexically identical, that is, identical apart from layout changes permitted by the source form. Neither of the example programs is standard conforming. Edits are provided to make this clear. EDITS: On page 194, subclause 12.3.2.1, in the fourth constraint following R1207 [194:19-20] delete 'and, if included, ... ' and add: If the includes , the interface-stmt> shall specify the same . If the includes ASSIGNMENT(=), the shall specify ASSIGNMENT(=). If the includes OPERATOR(), the shall specify the same . If one is .LT., .LE., .GT., .GE., .EQ., or .NE., the other shall not be <, <=, >, >=, ==, or /=. ....................................................................... SUBMITTED BY: Henry Zongaro HISTORY: 98-150 m145 Submitted