(j3.2006) Storage_size ??
Robert Corbett
robert.corbett
Wed Jul 31 02:21:20 EDT 2013
On 07/29/13 08:29, Bill Long wrote:
> Give the answers so far, it appears that the value returned is
> implementation-dependent, but is always loc(xx(2)) - loc(xx(1)).
Your question exposes assumptions that need not be true.
Suppose a program defines a type as
TYPE (T)
REAL V(1000)
END TYPE
and a variable of that type
TYPE(T) :: X
Because T is not a sequence or BIND(C) type, I think it would be standard
conforming for a processor to implement the variable X as a machine-level
pointer. The pointer might initially be set to NULL to signify that it is
undefined. If the variable first becomes defined, space would be allocated for
the structure and it would be initialized to the proper value. Under such a
scheme, the value of STORAGE_SIZE(X) would be the size of a machine-level
pointer in bits.
A similar scheme could not be used if T were a sequence type.
Bob Corbett
More information about the J3
mailing list