From owner-freebsd-arch@FreeBSD.ORG Thu Sep 1 15:15:34 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1612916A420 for ; Thu, 1 Sep 2005 15:15:34 +0000 (GMT) (envelope-from rodrigc@crodrigues.org) Received: from rwcrmhc12.comcast.net (rwcrmhc13.comcast.net [216.148.227.118]) by mx1.FreeBSD.org (Postfix) with ESMTP id 923D243D4C for ; Thu, 1 Sep 2005 15:15:32 +0000 (GMT) (envelope-from rodrigc@crodrigues.org) Received: from c-66-30-115-133.hsd1.ma.comcast.net ([66.30.115.133]) by comcast.net (rwcrmhc13) with ESMTP id <2005090115153101500j141ve>; Thu, 1 Sep 2005 15:15:31 +0000 Received: from c-66-30-115-133.hsd1.ma.comcast.net (localhost.127.in-addr.arpa [127.0.0.1]) by c-66-30-115-133.hsd1.ma.comcast.net (8.13.4/8.13.1) with ESMTP id j81FFV6r043644; Thu, 1 Sep 2005 11:15:31 -0400 (EDT) (envelope-from rodrigc@c-66-30-115-133.hsd1.ma.comcast.net) Received: (from rodrigc@localhost) by c-66-30-115-133.hsd1.ma.comcast.net (8.13.4/8.13.1/Submit) id j81FFVm5043643; Thu, 1 Sep 2005 11:15:31 -0400 (EDT) (envelope-from rodrigc) Date: Thu, 1 Sep 2005 11:15:31 -0400 From: Craig Rodrigues To: Bruce Evans Message-ID: <20050901151531.GA43623@crodrigues.org> References: <20050810005323.GA42721@crodrigues.org> <20050810032308.GA80916@dragon.NUXI.org> <20050827235140.GA3063@crodrigues.org> <20050828172712.T86328@delplex.bde.org> <20050831112720.GA55376@crodrigues.org> <20050831215640.S1678@epsplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050831215640.S1678@epsplex.bde.org> User-Agent: Mutt/1.5.9i Cc: freebsd-arch@freebsd.org Subject: Re: [RFC] -Wredundant-decls: keep it or remove it? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2005 15:15:34 -0000 On Wed, Aug 31, 2005 at 10:32:08PM +1000, Bruce Evans wrote: > This seems reasonable. Is it necessary to check TREE_PUBLIC () > explicitly? We have already avoided warning for externs, so only > weird cases are left. I can't see any reason not to use simply: > > /* Don't warn about a definition following a declaration. */ > if (DECL_INITIAL (newdecl) && !DECL_INITIAL (olddecl))) > > since a definition (i.e., a declaration with an initializer) following > a declaration (i.e., a tentative definition) can never be redundant. I think you are right. I submitted a modified patch based on what you suggested here: http://gcc.gnu.org/ml/gcc-patches/2005-09/msg00006.html and got approval for it on the GCC mainline here: http://gcc.gnu.org/ml/gcc-patches/2005-09/msg00019.html I'll try to get it into GCC soon. -- Craig Rodrigues rodrigc@crodrigues.org