From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2757 invoked by alias); 4 Jan 2003 00:16:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 2727 invoked by uid 71); 4 Jan 2003 00:16:01 -0000 Resent-Date: 4 Jan 2003 00:16:01 -0000 Resent-Message-ID: <20030104001601.2726.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, jbuck@synopsys.com Received: (qmail 1246 invoked by uid 61); 4 Jan 2003 00:12:11 -0000 Message-Id: <20030104001211.1244.qmail@sources.redhat.com> Date: Sat, 04 Jan 2003 00:16:00 -0000 From: jbuck@synopsys.com Reply-To: jbuck@synopsys.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/9165: [3.3/3.4 regression] false "defined but not used" warnings X-SW-Source: 2003-01/txt/msg00267.txt.bz2 List-Id: >Number: 9165 >Category: c++ >Synopsis: [3.3/3.4 regression] false "defined but not used" warnings >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri Jan 03 16:16:01 PST 2003 >Closed-Date: >Last-Modified: >Originator: Joe Buck >Release: 3.3-pre, 3.4-experimental >Organization: >Environment: GNU/Linux i686 (though probably all) >Description: gcc 3.3-pre and 3.4-experimental issue "defined but not used" warnings for static class objects whose destructors do cleanup operations. This is a more dangerous regression than it may appear, because it may inspire programmers to remove needed code from their applications, resulting in leaks and other failures. This is especially likely in shops that ask for clean -Wall compiles. This problem is not in gcc 3.2.1 or earlier versions. >How-To-Repeat: Compile with "gcc -c -O -Wall cleanup.cxx" where cleanup.cxx is ------------------------------ void do_cleanups(); class Cleanup { public: ~Cleanup() { do_cleanups();} }; static Cleanup dummy; --------------------------------- and get cleanup.cpp:8: warning: `Cleanup dummy' defined but not used >Fix: >Release-Note: >Audit-Trail: >Unformatted: