(j3.2006) Question about pointer components of coindexed objects
Malcolm Cohen
malcolm
Mon Jul 24 20:04:50 EDT 2017
Hi John,
Yes I understand that pointer association is local, duh.
But this is NULLIFY. It is breaking a pointer association, not creating one. Making a pointer disassociated is not difficult. I don?t care about the redundant useless ?pointer => Null()? that we added in F95.
Furthermore, the ?pointer becomes undefined? rule for cross-image pointer assignment (available by derived-type assignment) is that it becomes undefined if ?the pointer is pointer-assigned to a target on a different image?. That does not do any damage to a disassociated pointer, so we KNOW that pointer-assigning a disassociated pointer on another image causes disassociation, not undefinement.
Finally, your suggestion would be an INCOMPATIBLE TECHNICAL CHANGE.
I see no merit in your suggestion.
Cheers,
--
..............Malcolm Cohen, NAG Oxford/Tokyo.
From: j3-bounces at mailman.j3-fortran.org [mailto:j3-bounces at mailman.j3-fortran.org] On Behalf Of John Reid
Sent: Monday, July 24, 2017 5:59 PM
To: fortran standards email list for J3 <j3 at mailman.j3-fortran.org>
Subject: Re: (j3.2006) Question about pointer components of coindexed objects
Malcolm,
This looks to me like an oversight in F2008 that we have carried over to
F2015. We had a design objective that pointer association be local. For
allocate and deallocate, we have
C949 (R933) An allocate-object shall not be a coindexed object.
For pointer assignment, we have
C1024 (R1034) A data-pointer-object shall not be a coindexed object.
C1026 (R1037) A data-target shall not be a coindexed object.
We seem to have forgotten to have such a constraint for nullify. Note that
x[1]%p => null()
is not permitted.
John.
Malcolm Cohen 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 <http://mailman.j3-fortran.org/mailman/listinfo/j3%3cBR%3e%3e%3cBR%3e_______________________________________________%3cBR%3eJ3>
>
_______________________________________________
J3 mailing list
J3 at mailman.j3-fortran.org <mailto:J3 at mailman.j3-fortran.org>
http://mailman.j3-fortran.org/mailman/listinfo/j3
Disclaimer
The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.
This e-mail has been scanned for all viruses and malware, and may have been automatically archived by Mimecast Ltd, an innovator in Software as a Service (SaaS) for business.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.j3-fortran.org/pipermail/j3/attachments/20170725/df0e63fe/attachment.html
More information about the J3
mailing list