Neil Carlson said:
> Then X=>X_PTR(B) would make X an alias for that component of B (well,
> that's what I'd like it to do). The question is, must B have the TARGET
> attribute?
This is not a lot to do with interp 125, and lots to do with the TARGET
attribute.
If you've ever got a pointer P to an object T, that object
*******MUST*******
have the TARGET attribute.
No ifs, buts or maybes.
Otherwise the TARGET attribute would be completely pointless and we'd be
in the realms of C where any pointer can point to anything else (well,
strictly speaking, anything else of the same type, but many C programs
rely on being able to point to things of incorrect type), thus
inhibiting optimisation.
The only way of forcing "targettability" is to make your dummy argument
a POINTER. Then the actual argument must also be a pointer and
therefore its target will have the TARGET attribute. This is not very
convenient if you've just got a plain TARGET variable because it means
you have to create the pointer (to use as the actual arg) yourself, but
it is the only means provided by the standard (and probably the only
means provided by any compiler too).
Cheers,
--
...........................Malcolm Cohen, NAG Ltd., Oxford, U.K.
([log in to unmask])
|