Date: Thu, 26 May 2005 05:45:17 -0400 From: Craig Rodrigues <rodrigc@crodrigues.org> To: freebsd-current@freebsd.org Cc: Stefan Farfeleder <stefan@fafoe.narf.at> Subject: Re: [GCC 4.0 PATCH] devfs_vnops.c Message-ID: <20050526094517.GA82579@crodrigues.org> In-Reply-To: <20050526072801.GM596@wombat.fafoe.narf.at> References: <20050526020143.GA80396@crodrigues.org> <20050526072801.GM596@wombat.fafoe.narf.at>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050526094517.GA82579>