From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28453 invoked by alias); 3 Apr 2007 23:19:11 -0000 Received: (qmail 28426 invoked by uid 48); 3 Apr 2007 23:19:01 -0000 Date: Tue, 03 Apr 2007 23:19:00 -0000 Message-ID: <20070403231901.28425.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/29365] Unnecessary anonymous namespace warnings In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "spark at gcc dot gnu dot org" 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: 2007-04/txt/msg00259.txt.bz2 ------- Comment #10 from spark at gcc dot gnu dot org 2007-04-04 00:18 ------- (In reply to comment #9) > (In reply to comment #8) > > The following patch addresses the problem. > > Do we want to add a flag to control this ? > > Except if you look at the file name, you could get a case where you are no > longer warning about. That's why I asked if we want to add a flag to enable/disable this - although I think my patch is a reasonable compromise as a default, it's not perfect (it can never be perfect unless we do whole-program analysis). The patch prevents the warning IF the anonymous namespace was in the same main source file that it's currently compiling (e.g. *.cc file). I think this covers bulk of the false positives with very small number of the false negatives. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29365