J3/04-358r1 Date: 10 August 2004 To: J3 From: Van Snyder Subject: Interpretation request on procedure pointers NUMBER: TBD TITLE: Procedure pointers and the EXTERNAL attribute KEYWORDS: Procedure pointers, EXTERNAL DEFECT TYPE: Error STATUS: QUESTION: Is the following program unit standard conforming? SUBROUTINE SUB ( RPP ) REAL, EXTERNAL, POINTER :: RPP EXTERNAL, POINTER :: PP PROCEDURE(REAL), POINTER :: PPP => NULL() END SUBROUTINE SUB The last sentence of "5.1.2.6 EXTERNAL attribute" appears to indicate that it is allowed: "A procedure that has both the EXTERNAL and POINTER attributes is a procedure pointer." That the title of subclause 12.2.1.2 is "Characteristics of dummy procedures and dummy procedure pointers" suggests that it is allowed. That subclause continues "... whether it is a pointer, ..." so it was clearly envisioned that at least dummy procedures could have the POINTER attribute. C1216 appears to require PPP to be allowed: "C1216 (R1214) If => appears in , the procedure entity shall have the pointer attribute." On the other hand, C512 appears to prohibit RPP and PP: "C512 (R501) If the POINTER attribute is specified, the ALLOCATABLE, TARGET, EXTERNAL, or INTRINSIC attribute shall not be specified." and a conspiracy of C512, the second sentence of subclause 5.1.2.6 "This [EXTERNAL] attribute may also be specified by ... a ..." and the first paragraph of subclause 5.2 "The combination of attributes that may be specified for a particular entity is subject to the same restrictions ... regardless of the method of specification. This also applies to the PROCEDURE, EXTERNAL and INTRINSIC statements." appears to prohibit PPP. ANSWER: The program unit is standard conforming. It was an oversight that the EXTERNAL attribute was not removed from C512 during the development of the procedure pointer facility. It is not helpful that the last sentence of the first paragraph of subclause 5.2 refers to "PROCEDURE ... statements" where it should refer to "procedure declaration ... statements." EDIT: Delete ", EXTERNAL" from C512. Replace the last sentence of the first paragraph of subclause 5.2 by "This also applies to procedure declaration statements, and to EXTERNAL and INTRINSIC statements." SUBMITTED BY: Van Snyder HISTORY: 04-358 m169 submitted