[log in to unmask] writes:
> Michael Metcalf writes:
> > Message text written by Lars Mossberg
> > >After all, Fortran DOES support zero-sized objects and they DO exist and
> > ARE defined and
> > "a" and "b" DO point to the same target, or?<
> >
> > Agreed. But the standard says, in the definition of ASSOCIATED, that for
> > zero-size arrays the result is false.
> >
>
> This seems like an unfortunate choice. I often test pointer
> association status before deallocation....
Different issue. You are talking about the one-argument form of
associated, which asks whether a pointer is associated with anything.
That form works as you'd expect...Well, there are the issues of
undefined association status, which may not be something you'd
expect. But there is nothing special about zero size for that
form.
The special case for zero-sized arrays applies only to the
two-argument form of associated, which asks whether two pointers
areassociated *WITH THE SAME THING* (or whether a pointer is
associated with a particular target).
The standard says that two zero-sized pointers are never associated
with the same thing (since they have no elements in common). They
may still both be associated - just not with the same thing.
I do happen to think that the standard's choice is, as you say,
unfortunate. But at least its a less common situation.
--
Richard Maine
[log in to unmask]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|