(j3.2006) (SC22WG5.4006) [ukfortran] NOT on Paper 09-238

Aleksandar Donev donev1
Thu Jun 11 14:23:54 EDT 2009


On Thursday 11 June 2009 11:07, N.M. Maclaren wrote:

> ? ? 2) With a defined null value (i.e. like NULL())
But that is not a C address, is it? It is a value, for sure.

> ? ? 3) Pointing to the end of an array - such pointer values are
> fully valid, don't point to an object, but can be subscripted with
> (say) -1 to point to an actual, defined data object
> ? ? 4) Pointing to an incomplete array at the end of a structure or
> union - very like (3), but subtly different
Good to know C still does not understand arrays :-)

> (3) and (4) are merely a different way of pointing
> to valid objects. ?We experts know that Fortran has no equivalent
> feature, so interoperability is implausible.
C_F_POINTER is not about *direct* interoperability. It is about 
converting a C pointer to a Fortran pointer, so it is perfectly 
reasonable to allow one to obtain a Fortran pointer to some C object, 
such as the incomplete array at the end of some structure.

> But WHERE in the standard is that made clear?
No where, but it seems to me if one goes in such details C_F_POINTER has 
much bigger problems, notably, there are no stated restrictions on 
SHAPE. For example, if you have a C array of size 10, and a pointer to 
the middle of it (say element index 5), what is allowed for SHAPE? This 
would seem more basic than asking what is allowed if the C pointer is 
the address of the end of an structure with an incomplete array at the 
end or if it points to the element one past the end of an array.

Best,
Aleks

-- 
Aleksandar Donev, Ph.D.
Lawrence Postdoctoral Fellow @ Lawrence Livermore National Laboratory
High Performance Computational Materials Science and Chemistry
E-mail: donev1 at llnl.gov
Phone: (925) 424-6816  Fax: (925) 423-0785
Address: P.O.Box 808, L-367, Livermore, CA 94551-9900
Web: http://cims.nyu.edu/~donev/




More information about the J3 mailing list