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:
[...]
contains
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).
--
.
- Follow-Ups:
- Re: array-passing trick
- From: glen herrmannsfeldt
- Re: array-passing trick
- From: Gordon Sande
- Re: array-passing trick
- References:
- array-passing trick
- From: Michael Goerz
- Re: array-passing trick
- From: Ken Fairfield
- array-passing trick
- Prev by Date: Re: array-passing trick
- Next by Date: Re: memory leak?
- Previous by thread: Re: array-passing trick
- Next by thread: Re: array-passing trick
- Index(es):
Relevant Pages
|