From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28962 invoked by alias); 15 Jan 2011 21:50:14 -0000 Received: (qmail 28951 invoked by uid 22791); 15 Jan 2011 21:50:13 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 15 Jan 2011 21:50:09 +0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/47307] Uninitialized in this function: warning for initialized, no warning for uninitialized X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: dominiq at lps dot ens.fr X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Sat, 15 Jan 2011 22:26:00 -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 X-SW-Source: 2011-01/txt/msg01477.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47307 --- Comment #2 from Dominique d'Humieres 2011-01-15 21:50:05 UTC --- > In fact, the array 'lopt' is not initialized in the code, however, the compiler > does not give warning about that. I try the same code with g95, it give a > warning message 'used but not set' about 'lopt'. Add lopt(1,1) = 0 at the beginning of your code and the g95 warning just disappears! So don't rely too much of this kind of warning. > Any suggestions or comments? Thanks in advance! Searching bugzilla for "uninitialized" in the subject yields 52 entries for open pr (not counting those closed as INVALID, DUPLICATE, WONTFIX, ...). I let you browse the list to check if this pr is a duplicate of one of those (look for instance to pr24639, my choice is pr27120). As far as I understand the problem, (1) it could be as difficult to solve as running the code itself (think of an array of 10**9 elements set through a spaghetti code and forgetting to set only one element). Note this apply also to duplicate initialization (as in Fortran legalese;-). (2) the responsibility to use only set variables is on the user, not on the compiler.