[GCC 4.0 PATCH] devfs_vnops.c
Craig Rodrigues
rodrigc at crodrigues.org
Thu May 26 02:45:11 PDT 2005
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 at crodrigues.org
More information about the freebsd-current
mailing list