(j3.2006) Question I forgot to bring up at the meeting

Van Snyder Van.Snyder
Tue Jul 9 18:56:40 EDT 2013


On Tue, 2013-07-09 at 10:33 -0500, Bill Long wrote:
> If we want to allow VOLATILE variables in specification expressions,
> either we should warn the users about curious effects, or say that for
> the purposes of its use in a specification expression, treat the
> variable as if it did not have the VOLATILE attribute. Alternatively,
> just disallow it, an option that I think was implied by Van's original
> post.

Either way, we need words in the standard.

Can we handle this via an interp, such as the following?

QUESTION:

Does the standard require that the following subroutine

  subroutine Wobbly ( N )
    integer, intent(in), volatile :: N
    integer :: A ( n + n )
    integer :: B ( 2 * n )
    print *, size(a) == size(b)
  end subroutine Wobbly

always print "T"?

ANSWER:

The standard does not establish an interpretation for this subprogram.
It therefore does not conform to the standard.  This was not intended.
Edits are provided.

EDITS:

Either add something about the unpredictable effects of using variables
with the volatile attribute in specification expressions, or prohibit
them.

Or do we need to add it to the work plan for the 2020 standard?





More information about the J3 mailing list