To: J3 J3/26-200 From: Malcolm Cohen Subject: Interp F23/021 on pointers in COMMON and SIMPLE procedures Date: 2026-October-16 ---------------------------------------------------------------------- NUMBER: F23/021 TITLE: May a simple procedure depend on common pointer association? KEYWORDS: POINTER, COMMON, ASSOCIATED, SIMPLE DEFECT TYPE: Erratum STATUS: J3 consideration in progress REFERENCES: 24-007 QUESTION: Consider SIMPLE SUBROUTINE example(x) LOGICAL,INTENT(INOUT) :: x COMMON/C/p REAL,POINTER :: p x = ASSOCIATED(p) END SUBROUTINE Is this conforming? Constraint C15116 "A simple subprogram shall not contain a reference to a variable in a common block." is ineffective, as appearing in ASSOCIATED is not a reference. However, a pointer accessed by use or host association cannot have its pointer association status queried in this way in a simple procedure (constraint C15115 is effective, as it only permits inquiry function references that are constant expressions). That indicates that this example was probably not intended to be conforming. ANSWER: The example was not intended to be conforming. Simple procedures should not depend on nonlocal variables in this way. EDITS to 24-007: The best fix is probably to include variables in common in C15115 which is not defective, and to delete the defective C15116. This can be done without renumbering the rest of the constraints (such renumbering would be appropriate in the next revision, not in a corrigendum). [348:6] 15.8 Simple procedures, constraint C15115, after "shall not contain a designator" insert "\obs{of a variable in a common block, or}", making the whole constraint read: "C15115 A simple subprogram shall not contain a designator of a variable in a common block, or of a variable that is accessed by use or host association, unless the designator is part of a specification inquiry (10.1.11) that is a constant expression." [348:8] Same subclause, delete constraint C15116 which reads "C15116 A simple subprogram shall not contain a reference to a variable in a common block." SUBMITTED BY: Malcolm Cohen HISTORY: 26-nnn m241 Submitted ----------------------------------------------------------------------