Re: Question about out-of-bounds warning



Thomas Koenig <Thomas.Koenig@xxxxxxxxx> writes:

program main
integer :: i(2)
i (0:-1) = 1
end

Is this allowed? The assignment is a "do-nothing", but both
bounds are outside of the bounds of the array. Would a warning
be in order here?

Interesting: neither gfortran (GNU Fortran 95 (GCC) 4.3.0 20061223
(experimental)) nor Sun's f95 (f95: Sun Fortran 95 8.2 Patch 121020-04
2006/10/26) throw an error and both binaries run without any problems;
one difference occurs when I try to print "i": the Sun binary just print
zeroes while the gfortran binary prints random integers.

Sebastian
.