From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16762 invoked by alias); 22 Mar 2007 19:03:50 -0000 Received: (qmail 16669 invoked by uid 48); 22 Mar 2007 19:03:23 -0000 Date: Thu, 22 Mar 2007 19:03:00 -0000 Subject: [Bug fortran/31318] New: terminate program when un-allocated array is used X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "vivekrao4 at yahoo dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-03/txt/msg02140.txt.bz2 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