Re: g95 wish list
From: glen herrmannsfeldt (gah_at_ugcs.caltech.edu)
Date: 11/30/04
- Next message: Stewart Gordon: "Re: What do you prefer: real(8) or double precision and why?"
- Previous message: E P Chandler: "Re: bug in g95 ?"
- In reply to: Catherine Rees Lay: "Re: g95 wish list"
- Next in thread: Gordon Sande: "Re: g95 wish list"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 30 Nov 2004 10:46:07 GMT
Catherine Rees Lay wrote:
(big snip on dimension of (1) in various places)
> I don't follow this. If you treat DIMENSION X(1) as DIMENSION X(*) and
> an array with one element in it is passed, it's perfectly possible to
> have a bounds check which fails if the subroutine references X(2).
I hadn't noticed that, either. I am not sure what any version
of the standard says about non-matching dimensions in subroutines
and subroutine callers.
> There are, and have been for years, compilers which do bounds-checking
> on arrays with bounds of * (this is one of the tests in the Polyhedron
> benchmarks).
Well, it does get complicated in some of the cases being
discussed. Some other languages commonly use call by descriptor
for arrays, allowing the full dimension information to be
passed, but not allowing some of the other Fortran tricks that
have been described here. It should be possible, and not all
that hard with the computer power available to do this.
One could even use the trick of a link time fixup I described
earlier. Ugly, but it works.
> The only problem I can see is that if you always treat 1 as *, you lose
> the possibility of a check as to whether you passed an array of size 2
> to a subroutine where it is declared explicitly as size 1 and was
> actually supposed to be size 1. Both you and the compiler would have to
> be psychic to pick this one up in any case.
-- glen
- Next message: Stewart Gordon: "Re: What do you prefer: real(8) or double precision and why?"
- Previous message: E P Chandler: "Re: bug in g95 ?"
- In reply to: Catherine Rees Lay: "Re: g95 wish list"
- Next in thread: Gordon Sande: "Re: g95 wish list"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|