[J3] Does LHS of a pointer assignment have the POINTER attribute?
Robert Corbett
rpcorbett at att.net
Thu Oct 7 20:30:26 UTC 2021
Did you mean
fp(1:) = tar
instead of
fp(1:) => tar
?
We discussed this topic in the last meeting.
We decided that
c_sizeof(fp)
should be considered equivalent to
c_sizeof((fp))
.
Bob Corbett
> On Oct 7, 2021, at 9:57 AM, Daniel C Chen via J3 <j3 at mailman.j3-fortran.org> wrote:
>
>
> Consider the following code:
>
> use iso_c_binding
> integer, pointer :: fp(:)
> integer, target :: tar(10)
> fp => tar
> fp(1:) => tar
> print *, c_sizeof(fp(:)) ! case 1: conforming
> print *, c_sizeof(fp) ! case 2: not conforming
> print *, c_sizeof(fp(1:)) ! case 3: ??
> end
>
> fp(1:) can appear as the LHS of a pointer assignment, does it mean fp(1:) have the POINTER attribute? If so, case 3 is not conforming as POINTER is not interoperable.
>
> Thanks,
>
> Daniel Chen
>
> XL Fortran Development, Fortran Standard Representative
> IBM Toronto Software Lab
> Phone: 905-413-3056
> Tie: 969-3056
> Email: cdchen at ca.ibm.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20211007/a1104f74/attachment-0001.htm>
More information about the J3
mailing list