To: J3 J3/10-134 From: Van Snyder Subject: Interp F03/0138 Date: 2010 February 16 Interp F03/0138 as balloted --------------------------- Interp F03/0138 failed WG5 letter ballot ------------------------------------------------------------------------ NUMBER: F03/0138 TITLE: External as KEYWORDS: procedure name, procedure pointer, procedure pointer assignmant DEFECT TYPE: Erratum STATUS: Passed by J3 letter ballot QUESTION: 7.4.2 C727 says a " [that is a ] shall be the name of an external ... procedure...." To be passed as an actual argument, a procedure needs to have the EXTERNAL attribute, but there appears to be no such requirement for being a target in a procedure pointer assignment. (1) Is the following example standard-conforming? PROGRAM example1 PROCEDURE(),POINTER :: p PROCEDURE(REAL),POINTER :: q p => x CALL x q => y PRINT *,y(5) CALL p PRINT *,q(5) END SUBROUTINE x PRINT *,'ok so far' END FUNCTION y(n) y = SQRT(REAL(n)) END (2) If example1 is standard-conforming, is this example conforming? MODULE exmod PROCEDURE(),POINTER :: p CONTAINS SUBROUTINE test CALL p END SUBROUTINE END PROGRAM example2 USE exmod p => x CALL test END SUBROUTINE x PRINT *,'ok' END ANSWER: (1) Yes, this example is conforming. As correctly noted, there is no requirement for the EXTERNAL attribute in a procedure pointer assignment, and both X and Y are known within the main program to be external procedures. (2) This example was not intended to be conforming. An edit is provided to clarify this. EDIT: [144:5-6] In 7.4.2 Pointer assignment, constraint C727, Change "an external, module," to "a module", Change "or a procedure pointer" to "a procedure pointer, or an external procedure that is accessed by USE or host association and is referenced in the scoping unit as a procedure, or that has the EXTERNAL attribute". This makes the revised constraint "C727 (R742) A shall be the name of a module or dummy procedure, a specific intrinsic function listed in 13.6 and not marked with a bullet ($\bullet$), a procedure pointer, or an external procedure that is accessed by USE or host association and is referenced in the scoping unit as a procedure, or that has the EXTERNAL attribute." SUBMITTED BY: Van Snyder HISTORY: 09-281 m189 F03/0138 submitted - Passed by J3 meeting 09-xxx m190 Passed by J3 letter ballot #19 09-292 ------------------------------------------------------------------------ Edits for 09-007r3 ------------------ [159:1-2] In 7.2.2.2 Syntax of the pointer assignment statement, constraint C730 Change "external, internal," to "internal", Change "a procedure pointer" to "a procedure pointer, an external procedure that is accessed by USE or host association and is referenced in the scoping unit as a procedure or that has the EXTERNAL attribute". This makes the revised constraint "C730 (R740) A shall be the name of an internal, module, or dummy procedure, a procedure pointer, an external procedure that is accessed by USE or host association and is referenced in the scoping unit as a procedure or that has the EXTERNAL attribute, or a specific intrinsic function listed in 13.6 and not marked with a bullet ($\bullet$)." {Notice that "internal" had been added in 09-007r3.}