From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4059 invoked by alias); 22 Oct 2010 20:37:05 -0000 Received: (qmail 3875 invoked by uid 22791); 22 Oct 2010 20:37:02 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,MISSING_MID 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; Fri, 22 Oct 2010 20:36:58 +0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/46097] Switch to warn of global variables in a C++ shared object X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: redi at gcc dot gnu.org 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: 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: Fri, 22 Oct 2010 20:37: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: 2010-10/txt/msg01932.txt.bz2 Message-ID: <20101022203700.iqPqASTwWrEz6FYChebSOzNUWf7YY5-nl49_0RC7xgo@z> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46097 --- Comment #29 from Jonathan Wakely 2010-10-22 20:36:45 UTC --- (In reply to comment #28) > > Are those libraries that crash designed to be used via dlopen, rather than > > linking to them explicitly? > Apparently they are (the authors would have marked the shared object with the > nodlopen option :/). that would imply they RTFM ;) I'm not sure I can contribute anything more useful to this PR. I think it would be awesome the compiler or linker could diagnose ODR violations, but I have no idea how to go about doing that. Personally I don't think a warning about using global variables is the right solution unless it can be tuned to only warn about potentially dangerous cases. I'm not going to close this PR as invalid though, if someone else can see how to make a useful warning then I'd be all for it