[J3] Does LHS of a pointer assignment have the POINTER attribute?

Daniel C Chen cdchen at ca.ibm.com
Thu Oct 7 16:57:15 UTC 2021


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/e70ddcee/attachment.htm>


More information about the J3 mailing list