This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/36761] Unallocated array "referenced" silently
- From: "jvdelisle at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Mar 2009 01:01:55 -0000
- Subject: [Bug fortran/36761] Unallocated array "referenced" silently
- References: <bug-36761-14178@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from jvdelisle at gcc dot gnu dot org 2009-03-30 01:01 -------
The first right statement in the original test case is valid fortran and gives
the correct result.
The second write statement is invalid Fortran. An unallocated allocatable array
has no size. It is up to the programmer to use "allocated" to confirm that the
array has a size before using it. This is what allocated is for.
Therefore this gets down to the same issue as 20520, using an allocatable array
before it is allocated. This is regardless of how it is invalidly used, in an
arithmetic statement or a write statement. See comments I added 20 20520.
*** This bug has been marked as a duplicate of 20520 ***
--
jvdelisle at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Keywords| |accepts-invalid
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36761