AW: [patch,wip] warn on noncontiguous pointers

Bader, Reinhold Reinhold.Bader@lrz.de
Fri Sep 28 05:12:00 GMT 2018


Hi Thomas, 

> -----Ursprüngliche Nachricht-----
> Von: Thomas Koenig <tkoenig@netcologne.de>
> Gesendet: Donnerstag, 27. September 2018 19:24
> An: Bader, Reinhold <Reinhold.Bader@lrz.de>; fortran@gcc.gnu.org
> Betreff: Re: [patch,wip] warn on noncontiguous pointers
> 
> Hi Reinhold,
> 
> >> If we go down the list, we see that fptr1(4:) is not contiguous; it
> >> is not an array (it is a pointer), so (4) also does not apply.
> > I don't agree with this conclusion. First, the array and pointer
> > properties are not mutually exclusive (they are conveyed by specifying
> > the DIMENSION and POINTER attribute, independently).
> 
> Can you maybe elaborate a bit more?
> 
> I see that you can associate a pointer with a target (6.7.1.4), which of course
> can be an array. But I have not found anything in the standard that says that a
> pointer to an array is an array.

OK. Looking at 5.3.8.1 (Fortran 2008 for the sake of this discussion), we have that
an object that has the DIMENSION attribute is an array. array-spec includes deferred-shape-spec-list, 
so any object declared with deferred shape is an array. 

5.3.8.4 then says
C532 An array with the POINTER or ALLOCATABLE attribute shall have an array-spec that is a deferred-shape-spec-list.

and then has further text to say at what point things like SHAPE or SIZE of such an object become defined.

It can't get any clearer than that. 

Cheers
Reinhold

> 
> Regards
> 
> 	Thomas



More information about the Fortran mailing list