PR23152 - namelist can't contain an assumed size array - a standardsquestion
Paul Thomas
paulthomas2@wanadoo.fr
Wed Aug 10 21:13:00 GMT 2005
Richard,
I think that we have arrived at a conclusion.
> Oh. Completely wrong direction (IMO). "Constant bounds" means that the
> bounds are all given by "constant expressions" (a category of
> expression removed in f2003 - I think it was 2003 - anyway in one of
> the revisions - it is mostly replaced by initialization expressions)
The net result is that, whether formally correct or not, the practical
outcome of my view is in accord with f2003.
> *ALL* arrays have bounds. The compiler might or might not know the
> bounds at compile time. The bounds might even not be known to the
> run-time library at rune time (in the case of assumed size). But the
> array still has bounds; that is a fundamental array concept. Ok, I
> suppose that an unallocated allocatable array or a pointer that is not
> associated might be said to not have bounds (or maybe it has bounds,
> but they are undefined - that's a fine distinction). But nothing about
> the wording in question says anything about "fed them by the compiler".
That was loose terminology, I agree, but is effectively the reason for
the F2003 change.
> Anyway, it is the assumed size case that I guess one could at least
> argue with, on the basis that there isn't an upper bound in the last
> dimension at all, so there isn't a nonconstant bound. I think that
> would be the wrong interpretation, but I can see how someone could get
> it from reading the words of the standard. But an assumed-shape array
> has bounds as described in 5.1.2.5.2.
Since both you and the commercial compiler developers are at one, I will
ensure that -std=f95 delivers stern errors for both assumed size and
assumed shape and that -std=f2003 or -std=gnu only pick on the former.
As it happens, this is consistent with what is possible from the
information that is available in scope.
Thanks for the help.
Paul T
More information about the Fortran
mailing list