public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "vivekrao4 at yahoo dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/31318]  New: terminate program when un-allocated array is used
Date: Thu, 22 Mar 2007 19:03:00 -0000	[thread overview]
Message-ID: <bug-31318-9647@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2007-03-22 19:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-22 19:03 vivekrao4 at yahoo dot com [this message]
2007-03-22 22:33 ` [Bug fortran/31318] Run-time check for using deallocated variables burnus at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-31318-9647@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).