To: J3 08-284 From: John Reid, Bill Long Subject: Interpretation re pure procedures and VOLATILE Date: 2008 October 30 NUMBER: F03/xxxx TITLE: References to VOLATILE variables in pure procedures KEYWORDS: VOLATILE, pure DEFECT TYPE: Error STATUS: J3 consideration in progress QUESTION: Was it intended to allow a VOLATILE variable to be referenced in a pure procedure? ANSWER: No. For example, it was intended that the result of invoking a pure function in a FORALL assignment statement should never depend on the order in which the invocations are executed, see NOTE 12.44. DISCUSSION: The arguments of a PURE function are required to have intent(in) so cannot be VOLATILE (see constraint C526). However, a VOLATILE variable may be accessed from the host, a module, or a common block. Also a non-VOLATILE variable may be accessed and given the VOLATILE attribute. The value of a variable with the VOLATILE attribute might change between invocations of the function in ways incompatible with the design intended for pure functions. EDIT: [286:22+] In 12.6, Pure procedures, add a new constraint: "C1271a The value, allocation status, or pointer association status of a variable with the VOLATILE attribute shall not be referenced or defined in a pure subprogram." SUBMITTED BY: John Reid and Bill Long HISTORY: N1745 m186 Problem raised by Nick Maclaren for VOLATILE coarrays.