Re: array-passing trick
- From: dpb <none@xxxxxxx>
- Date: Wed, 18 May 2011 16:13:44 -0500
On 5/18/2011 2:41 PM, Ken Fairfield wrote:
dpb got most of the points, but missed the following:
On May 18, 10:41 am, Michael Goerz<news...@xxxxxxxxxxxxxxx> wrote:
subroutine print_a(a, n)
integer, intent(in) :: a(1) ! does NOT work with a(2)
The above "a(1)" is an F66-ism, is non-standard and compiler-
dependent. In fact, you're lying to the compiler. A good
checking compiler should complain on the second trip
through the loop, below, when i=2 and you reference a(i)
which is outside the declared bounds of "a".
I was "underneath the impression" (as a walking-malapropism-collection of a former colleague used to say :) ) that there was still a special dispensation for the form for backwards compatibility?
Or has that actually gone away so that it is compiler-dependent? There surely is a lot of code around that uses the construct that would break at runtime if it were enforced (altho runtime checking is something different, recognized).