From owner-freebsd-current@FreeBSD.ORG Thu May 26 09:45:11 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7D43E16A420 for ; Thu, 26 May 2005 09:45:11 +0000 (GMT) (envelope-from rodrigc@crodrigues.org) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1EB8443D1D for ; Thu, 26 May 2005 09:45:10 +0000 (GMT) (envelope-from rodrigc@crodrigues.org) Received: from dibbler.crodrigues.org (c-66-30-114-143.hsd1.ma.comcast.net[66.30.114.143]) by comcast.net (sccrmhc12) with ESMTP id <2005052609450901200a181ue>; Thu, 26 May 2005 09:45:10 +0000 Received: from c-66-30-114-143.hsd1.ma.comcast.net (localhost.127.in-addr.arpa [127.0.0.1]) by dibbler.crodrigues.org (8.13.3/8.13.1) with ESMTP id j4Q9jIPE082642; Thu, 26 May 2005 05:45:18 -0400 (EDT) (envelope-from rodrigc@c-66-30-114-143.hsd1.ma.comcast.net) Received: (from rodrigc@localhost) by c-66-30-114-143.hsd1.ma.comcast.net (8.13.3/8.13.1/Submit) id j4Q9jHCv082641; Thu, 26 May 2005 05:45:17 -0400 (EDT) (envelope-from rodrigc) Date: Thu, 26 May 2005 05:45:17 -0400 From: Craig Rodrigues To: freebsd-current@freebsd.org Message-ID: <20050526094517.GA82579@crodrigues.org> References: <20050526020143.GA80396@crodrigues.org> <20050526072801.GM596@wombat.fafoe.narf.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050526072801.GM596@wombat.fafoe.narf.at> User-Agent: Mutt/1.5.9i Cc: Stefan Farfeleder Subject: Re: [GCC 4.0 PATCH] devfs_vnops.c X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2005 09:45:11 -0000 On Thu, May 26, 2005 at 09:28:02AM +0200, Stefan Farfeleder wrote: > > What do people think of the following patch to fix it? > > > > http://people.freebsd.org/~rodrigc/devfs_vnops.c.diff.txt > > Contrary to what Poul-Henning said, in this case it's perfectly legal to > use: > > static struct foo bar; > [...] > static struct foo bar = { ... }; If I change the code in devfs_vnops.c as follows: --- devfs_vnops.c.orig Wed May 25 19:58:21 2005 +++ devfs_vnops.c Thu May 26 05:34:08 2005 @@ -111,8 +111,8 @@ #endif static vop_symlink_t devfs_symlink; -extern struct vop_vector devfs_vnodeops; -extern struct vop_vector devfs_specops; +static struct vop_vector devfs_vnodeops; +static struct vop_vector devfs_specops; static u_int devfs_random(void) Then I get this compiler warning with gcc 4.0: cc1: warnings being treated as errors /usr/src/sys/fs/devfs/devfs_vnops.c:1389: warning: redundant redeclaration of 'devfs_vnodeops' /usr/src/sys/fs/devfs/devfs_vnops.c:114: warning: previous declaration of 'devfs_vnodeops' was here /usr/src/sys/fs/devfs/devfs_vnops.c:1411: warning: redundant redeclaration of 'devfs_specops' /usr/src/sys/fs/devfs/devfs_vnops.c:115: warning: previous declaration of 'devfs_specops' was here So, with that in mind, is there any objection to the patch at: http://people.freebsd.org/~rodrigc/devfs_vnops.c.diff.txt It moves things around, but I can compile with no warnings or errors with GCC 4.0. -- Craig Rodrigues rodrigc@crodrigues.org