Aleksandar Donev said:
> fails with a certain (immature) compiler:
>
> p=>test%t%x
> ^
> Error 103 : The target of a pointer must be a target or a pointer
>
> which I believe is wrong since test does not need the TARGET attribute
> since t is a pointer and does x inherits it implicitly from t.
Well, certainly TEST%T being a pointer means that anything it points at has
the TARGET attribute: the F95 standard says
"Allocation of a pointer creates an object that implicitly has the TARGET
attribute."
(page 81, second sentence in 6.3.1.3).
OTOH, the text which is meant to propagate the TARGET attribute down into
subobjects (in the middle of page 75) is broken, leaving this particular
case apparently unspecified - though the intent of the standard is IMO
clear (assuming the converse quickly leads to an inconsistency).
You should be able to programme around this with
type(A),pointer :: pt
...
pt => test%t
p => pt%x
which unambiguously satisfies the standard without relying on the common
sense interpretation of page 75.
Though since I don't have the compiler in question, I cannot say whether
they got this one right!
Sigh. This sort of sloppy wording in the standard really ought to be
fixed; I'll follow it up on J3 with an interp request (and make sure it is
not broken in F2002).
Cheers,
--
...........................Malcolm Cohen, NAG Ltd., Oxford, U.K.
([log in to unmask])
|