[J3] Question not just for HPC

Bill Long longb at cray.com
Thu Oct 17 08:54:51 EDT 2019

A “variable definition context” is intended to be something that is detectable at compile time (and hence can be used in a constraint).   For a data pointer, which is a variable, it’s definition state depends on the definition state of its target. If it is not associated with a target, it is undefined.   In this example, the pointer assignment does not change the definition of the pointer because the target is not defined and the pointer was previously not associated.  So, not defined before, and not defined after => no change in definition status.   The list in 19.6.7 does not list pointer association as a variable definition context.  (Note that a pointer also has a “pointer definition status” which can be undefined, associated, or disassociated.  That does change here (from undefined to associated), but is separate from the definition of the pointer as a variable.)


> On Oct 17, 2019, at 4:59 AM, John Reid via J3 <j3 at mailman.j3-fortran.org> wrote:
> Malcolm Cohen via J3 wrote:
>> Please use the current standard to answer the question, not some other document.
> Whoops! I was looking at 10-007r1 because I wondered what was the situation in F08. So is there an inconsistency? It looks to me as if the compilers that rejected the statement x%q => p were correct for F08.
> To recap, item (3) in 16.6.7 (of 10-007r1) says that a pointer assignment is a variable definition context and C1303 (of 10-007r1) says
> "A lock variable shall not appear in a variable definition context except as the lock-variable in a LOCK or UNLOCK statement, as an allocate-object, or as an actual argument in a reference to a procedure with an explicit interface where the corresponding dummy argument has INTENT (INOUT)."
> Cheers,
> John.

Bill Long                                                                       longb at cray.com
Principal Engineer, Fortran Technical Support &   voice:  651-605-9024
Bioinformatics Software Development                      fax:  651-605-9143
Cray, a Hewlett Packard Enterprise company/ 2131 Lindau Lane/  Suite 1000/  Bloomington, MN  55425

More information about the J3 mailing list