(j3.2006) Question about pointer components of coindexed objects
John Reid
John.Reid
Mon Jul 24 10:47:23 EDT 2017
Clune, Thomas L. (GSFC-6101) wrote:
> 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.
You have made me realize that in my earlier message, I discussed only
NULLIFY.
In 16.9.1 [353:5-6], which is talking about the specifications of the
intrinsic procedures, we have "The ?Argument(s)? paragraphs specify
requirements on the actual arguments of the procedures." so I see no
problem with Malcolm's note re C1542.
Clause 16 does not talk about dummy arguments of intrinsic procedures
except in 16.9.1 [353:6], following the sentence I have just quoted:
"The result characteristics are sometimes specified in terms of the
characteristics of dummy arguments." I don't see this sentence as
helpful. Could we delete it?
John.
>
>
>> 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
>
>
>
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3
>
More information about the J3
mailing list