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

Reuben D. Budiardja reubendb at ornl.gov
Thu Oct 7 19:25:17 UTC 2021


On 10/07/2021 12:57 PM, Daniel C Chen via J3 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.

Why is case 1 conforming?

Best,
Reuben


More information about the J3 mailing list