(j3.2006) Question about pointer components of coindexed objects

Malcolm Cohen malcolm
Mon Jul 24 02:25:08 EDT 2017


Hi folks,

 

Consider:

 

Program n9a

  Type t

    Integer,Pointer :: p

  End Type

  Type(t) x[*]

  Nullify(x[1]%p)

  Print *,'ok if F?',Associated(x[1]%p)

End Program

 

There are two questions:

 

(1)  Is the NULLIFY conforming?  It certainly looks conforming to me.
However another compiler claims that it is not permitted.

 

(2) If the ASSOCIATED conforming?  Since we're allowed to follow pointers on
other images, e.g. "x[1]%p = 3", I don't see why it should be a problem.
However, one compiler thinks it falls foul of 

                C1542 The actual argument corresponding to a dummy pointer
shall not be a coindexed object.

It is not at all obvious that C1542 should apply to intrinsic procedures.  A
second compiler claimed that x[1]%p was not a pointer, throwing further
confusion onto the fire.  Anyway, I think that either ASSOCIATED should say
that you can't use it on coindexed objects, or C1542 should be followed by a
Note saying it does not apply to the ASSOCIATED intrinsic, to clarify the
situation.

 

Any comments about these cases would be welcome (especially from Bill!).

 

Cheers,

-- 

..............Malcolm Cohen, NAG Oxford/Tokyo.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.j3-fortran.org/pipermail/j3/attachments/20170724/2fa48df4/attachment.html 



More information about the J3 mailing list