This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31318] New: terminate program when un-allocated array is used
- From: "vivekrao4 at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Mar 2007 19:03:23 -0000
- Subject: [Bug fortran/31318] New: terminate program when un-allocated array is used
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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