Re: Question about out-of-bounds warning
- From: Sebastian Hanigk <hanigk@xxxxxxxxx>
- Date: Wed, 31 Jan 2007 22:13:48 +0100
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
.
- Follow-Ups:
- Re: Question about out-of-bounds warning
- From: Craig Powers
- Re: Question about out-of-bounds warning
- From: FX
- Re: Question about out-of-bounds warning
- References:
- Question about out-of-bounds warning
- From: Thomas Koenig
- Question about out-of-bounds warning
- Prev by Date: Question about out-of-bounds warning
- Next by Date: Re: Question about out-of-bounds warning
- Previous by thread: Question about out-of-bounds warning
- Next by thread: Re: Question about out-of-bounds warning
- Index(es):