J3/13-298r2 To: J3 From: Van Snyder & Malcolm Cohen Subject: Interp on VOLATILE in specification expressions Date: 2013 October 16 ---------------------------------------------------------------------- NUMBER: F08/0099 TITLE: VOLATILE in specification expressions KEYWORD: VOLATILE, specification expression DEFECT TYPE: Interpretation. STATUS: J3 consideration in progress QUESTION: Is the following subprogram required always to print "T T"? subroutine Wobbly ( N ) integer, volatile :: N integer :: A ( n, n ) integer :: B ( n * n ) print *, size(a) == size(b), size(a,1) == size(a,2) end subroutine Wobbly ANSWER: No. There are three specification expressions in the subroutine, and the volatile variable N appears in each of them. Since, being volatile, the variable N might have a different value each time it is referenced, these three specification expressions might receive different values for their references to N. If that happens, the array sizes might well be different. SUBMITTED BY: Van Snyder HISTORY: m202 13-298r1 Submitted m202 13-298r2 Revised answer ----------------------------------------------------------------------