Print

Print


Jan van Oosterwijk said:
> If this is correct, it is new to me. My - more or less inconscious -idea
> alway was that the 'x' component only could have an implicit
> TARGET attribute if it was a pointer.

Well, it's part of something which *DOES* has the target attribute.

And if it (the pointer) is not wrapped up in a derived type, so does the
component.  That is crystal clear from the standard.

What is not said anywhere (in the standard) is what happens if it (the
pointer again) is wrapped up in a derived type.

i.e., given two pointers P and V%P, to a derived type T with nonpointer
component X,

We know that P%X has the TARGET attribute (the standard says so).
We don't know that V%P%X has the TARGET attribute (the standard is silent).

i.e.  (suppose we have a pointer PX which can point to whatever sort of
thing X is) we can do
  PX => P%X   ! The standard says we can
and we can do
  P => V%P    ! Trivial
  PX => P%X
but the standard is silent on whether we can do
  PX => V%P%X

Clearly, the third one ought to be allowed as well!

> I must say that my documentation consists of
> (1) ISO/IEC 1539 (1991) (E)
> (2) Draft J3/97-007R1
> (3) Draft J3/02-007R1

None of these are Fortran 95.  For something close to F95, you want
J3/97-007R2 (or even 97-007 without the "R").  97-007R1 is the first
start along the path of producing the F2002 draft.  Yes, the numbering
is confusing - an accident of history.

> I now find that (2) and (3) differ from (1) in section 6.1.2.
>
> The description of INTENT, TARGET or PARAMETER attribute propagation
> seems to have disappeared.
>
>
> Can someone explain?

Yes, you are looking at draft F2002 documents (one of them very old!) which
describe the attribute propagation differently and elsewhere.

Cheers,
--
...........................Malcolm Cohen, NAG Ltd., Oxford, U.K.
                           ([log in to unmask])