(j3.2006) Question about Comment GB20 on CFI_is_contiguous

Malcolm Cohen malcolm
Tue Sep 27 22:59:11 EDT 2011

On Tue, 2011-09-27 at 18:13 -0700, Malcolm Cohen wrote:
> In any case, I think the wording needs to be tightened up re
> unallocated/disassociated.  Simply disallowing these cases is I think
> the best option, especially since they are not allowed in the Fortran
> intrinsic.

Van suggested:
>An alternative for the unallocated/disassociated case is that the
>function result is false, since an unallocated/disassociated array can't
>possibly be contiguous.

I think that this can only make sense with option (b), not option (a).  Yes 
option (b) is my preferred option but it is not the only one on the table.

I do think it is slightly counter-intuitive for an allocatable array to ever be 
discontiguous, even if that is only when it does not exist.

Philosophically "false" does not really make sense - it could just as easily be 
argued that it can be determined that there are no array elements with gaps 
between them (since there are no array elements, indeed no array!), therefore 
"it" is contiguous.

>If the code continues to another place where it actually tries to use
>the target of the pointer etc., that's when it will get into trouble.

Why else would it be even thinking about the contiguity.  This argument works 
better as an argument for option (c), which I already rejected.

We should only be thinking of allowing something if a good case can be made out 
for reasonable use (cf my thoughts on the scalar case).  I think I made out such 
a case for scalar ... but even so, I am willing to be convinced that it is a 
"clear error" if that is the majority opinion.  I see no grounds here for 
allowing disassociated/unallocated other than to postpone any possibility of 
error detection - that is not, in my view, reasonable grounds.

................................Malcolm Cohen, Nihon NAG, Tokyo. 

More information about the J3 mailing list