To: J3 J3/13-226 From: Dick Hendrickson Subject: Interp from c.l.f Date: 2013 January 01 NUMBER: F08/ZZZZ TITLE: Can an allocate with SOURCE= have side-effects in a Pure procedure? KEYWORDS: Allocate, SOURCE=, PURE, side-effects DEFECT TYPE: Erratum STATUS: Under J3 consideration QUESTION: On comp.lang.fortran Ian Harvey brought up a pointer/PURE question. Given a type definition like type :: int_ptr integer, pointer :: i end type int_ptr And a PURE function like PURE function FUN (arg) type(int_ptr), intent(in) :: arg type(int_ptr), allocatable :: tmp FUN = 1 allocate (tmp, source=arg) tmp%i = 2 end function fun Is FUN standard conforming? Doesn't the use of source=arg allow the function to modify a global entity via the tmp%i = ...? There don't seem to be any constraints on what arg%i can point to, which means that the assignment to tmp%i can have side effects. C1283(1) prevents usage like arg%i = 2 ANSWER Of course it isn't standard conforming! Words modeled after C1283(4) will be added. EDITS Add to C1283: "..." SUBMITTED BY: Dick Hendrickson HISTORY: 13-WWW m200 F08/ZZZZ submitted