[Bug fortran/31318] New: terminate program when un-allocated array is used
vivekrao4 at yahoo dot com
gcc-bugzilla@gcc.gnu.org
Thu Mar 22 19:03:00 GMT 2007
For the illegal code
integer, allocatable :: ivec(:)
print*,"shape(ivec)=",shape(ivec)
end
gcc version 4.3.0 20070315 (experimental)
gfortran -W -Wall -pedantic-errors -std=f2003 -fbounds-check -Werror
xshape_alloc.f90
gives
shape(ivec)= 4298784
It would be nice if a run-time error message about the use of array that has
not been allocated were emitted. A fairly common mistake I make is to pass an
array that is allocatable in the caller, before having
allocated it, to a procedure as an argument which is
not allocatable. Within the procedure, applying SIZE
or SHAPE will give strange results.
--
Summary: terminate program when un-allocated array is used
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: vivekrao4 at yahoo dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31318
More information about the Gcc-bugs
mailing list