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

Clune, Thomas L. GSFC-6101 thomas.l.clune
Mon Jul 24 08:28:32 EDT 2017


It would be pretty useless to allow following pointers on other images if we cannot safely check their association.  As such, I?d be strongly in favor of the suggested note for C1542.    I?m more neutral on NULLIFY.   Modifying the state of a pointer on another image would seem to be a more complex thing than accessing elements of its target.

- Not Bill





On Jul 24, 2017, at 2:25 AM, Malcolm Cohen <malcolm at nag-j.co.jp<mailto:malcolm at nag-j.co.jp>> wrote:

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.

_______________________________________________
J3 mailing list
J3 at mailman.j3-fortran.org<mailto:J3 at mailman.j3-fortran.org>
http://mailman.j3-fortran.org/mailman/listinfo/j3

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



More information about the J3 mailing list