This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Bad Fortran Code or Compiler Bug
Steve Kargl <sgk@troutmask.apl.washington.edu> writes:
> On Wed, Apr 06, 2005 at 08:06:21PM -0400, Jim Dishaw wrote:
> > I expected "CALL table(slabs%x)" to pass an array of x values, but no
> > such look. Neither "CALL table(slabs(0:5)%x)" or "CALL
> > table(slabs(1:5)%x)" work as I expected. What is getting passed is just
<snip>
>
> What is the output you expect? As much fun as it is to debug other
> people's code, it is quite hard to read their minds.
>
Quite true.
The output that I was expecting, which is what Compaq Visual Fortran
produces, is
Calling tables(slabs%x)
1 0.000000
2 0.500000
3 1.000000
4 1.500000
5 2.000000
6 2.500000
etc
what I get instead is
Calling tables(slabs%x)
1 0.000000
2 0.500000
3 47.00000
4 0.500000
5 0.500000
6 47.00000
7 1.000000
8 0.500000
9 47.00000
etc
Note that the output is the actual layout of the slabs array in memory.
The "CALL tables(slabs%x)" should only pass the x values from the
slabs array, or at least that is my understanding of the language
spec.
-jd