Subject: kern/2277: sys/sys/conf.h contains bogus "#define lkmenodev enodev"
To: None <gnats-bugs@NetBSD.ORG>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: netbsd-bugs
Date: 03/31/1996 09:48:22
>Number: 2277
>Category: kern
>Synopsis: Conflicting prototypes for enodev when LKM not configured
>Confidential: no
>Severity: non-critical
>Priority: high
>Responsible: kern-bug-people (Kernel Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Mar 31 13:20:02 1996
>Last-Modified:
>Originator: Jonathan Stone
>Organization:
>Release: NetbSD-current as supped at 31-march-1996
>Environment:
System: NetBSD Reno.DSG.Stanford.EDU 1.1B NetBSD 1.1B (NEWCONF) #9: Thu Mar 28 07:33:55 PST 1996 jonathan@Reno.DSG.Stanford.EDU:/usr/src/sys/arch/pmax/compile/NEWCONF pmax
>Description:
sys/sys/conf.h contains a bogus "#define lkmenodev enodev",
which is in scope if loadable kernel modules aren't configured.
At least on a Pmax, this causes a prototype for lkmenodev() in systm.h
to end up being an additional, conflicting, prototyped declaration
for enodev().
This causes kernel builds to fail.
Reno> echo "conf.h:" ; grep lkmenodev /sys/sys/conf.h ; echo "systm.h:"; grep enodev /sys/sys/systm.h
conf.h:
(dev_type_open((*))) lkmenodev, (dev_type_close((*))) enodev, \
(dev_type_open((*))) lkmenodev, (dev_type_close((*))) enodev, \
# define lkmenodev enodev
systm.h:
int enodev __P((void));
int lkmenodev __P((dev_t, int, int, struct proc *));
>How-To-Repeat:
Configure a kernel (certainly pmax, but possibly any port) without LKM.
Compile. Watch nfs_vfsops.c fail to compile.
>Fix:
I haven't tried it, but adding #ifdef LKM/#endif around the prototype
for lkmenodev() should definitely fix this.
Perhaps the declaration of lkmenodev() should be moved from systm.h
to conf.h, if that's where this (ugly) #define is going to be?
>Audit-Trail:
>Unformatted: