From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23832 invoked by alias); 10 Nov 2013 19:57:02 -0000 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 Received: (qmail 23795 invoked by uid 55); 10 Nov 2013 19:56:59 -0000 From: "sgk at troutmask dot apl.washington.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/59065] questionable bounds for unassociated allocatable/pointer arrays? Date: Sun, 10 Nov 2013 19:57:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: sgk at troutmask dot apl.washington.edu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-11/txt/msg00978.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59065 --- Comment #3 from Steve Kargl --- On Sun, Nov 10, 2013 at 07:46:55PM +0000, zeccav at gmail dot com wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59065 > > --- Comment #2 from Vittorio Zecca --- (compiler results deleted to keep this short). Thanks for checking other compilers. > All of them put SIZE to zero that looks to me better > than one as gfortran does. So, how does one distinguish bewteen a valid and an invalid program? program foo integer, allocatable :: i(:) allocate(i(0)) print *, size(i) end This has a valid zero sized array, whereas this doesn't program foo integer, allocatable :: i(:) print *, size(i) end > But best behavior is g95's that detects the bug, and displays the > correct line number Agreed. Detecting bugs is better. But, the best behavior would be for the programmer not to write invalid code. :-)