Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Sep 1995 13:44:35 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        current@freebsd.org
Subject:   test coverage of LINT
Message-ID:  <199509100344.NAA19536@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
`grep 'define N.*0'' in /sys/compile/LINT should produce no output but
actually produces the left half of the following:

ata.h:#define NATA 0				# source files missing
bqu.h:#define NBQU 0				# should be enabled ???
crd.h:#define NCRD 0				# under development
devfs.h:#define NDEVFS 0			# under development
eisa.h:#define NEISA 0				# never completely worked
eon.h:#define NEON 0				# broken/not supported
gpl_math_emulate.h:#define NGPL_MATH_EMULATE 0	# conflicts with MATH_EMULATE
gusxvi.h:#define NGUSXVI 0			# broken (actually in LINT)
ibcs2.h:#define NIBCS2 0			# should be enabled ???
imp.h:#define NIMP 0				# source files missing
ipacct.h:#define NIPACCT 0			# bug in config: IPACCT is defined
is.h:#define NIS 0				# source files missing
iso.h:#define NISO 0				# broken (actually in LINT)
kadb.h:#define NKADB 0				# source files missing
llc.h:#define NLLC 0				# bug in config: LLC is defined
mfs.h:#define NMFS 0				# bug in config: MFS is defined
od.h:#define NOD 0				# source files missing
pcic.h:#define NPCIC 0				# under development
ssc.h:#define NSSC 0				# should be enabled ???
sscape.h:#define NSSCAPE 0			# should be enabled ???
su.h:#define NSU 0				# should be enabled ???
sysvsem.h:#define NSYSVSEM 0			# bug in config: SYSVSEM is defined
sysvshm.h:#define NSYSVSHM 0			# bug in config: SYSVSHM is defined
tb.h:#define NTB 0				# broken
tcpdebug.h:#define NTCPDEBUG 0			# should be enabled ???
tpip.h:#define NTPIP 0				# broken (actually in LINT)
trix.h:#define NTRIX 0				# should be enabled ???

Can anyone explain why config defines NMFS as 0 although MFS is defined?
The bug has something to do with mfs being cross referenced to ffs.
Nothing actually includes mfs.h, but config doesn't know that so it
should touch the file if the MFS option has changed, but it doesn't even
do that since the file contents doesn't change like it should.  For lfs.h,
the behaviour is different but probably still broken: if the LFS option
isn't enabled, then lfs.h defines NLFS as 0; otherwise lfs.h isn't created.
Nothing actually includes lfs.h so there is no problem in practice (but
config doesn't know that).

Option processing seems to work right for drivers.

BTW1, most drivers are unecessarily ifdefed with

#include "foo.h"
#if NFOO > 0
<body of driver>
#endif

NFOO is guaranteed to be > 0 if the driver is configured (except possibly
for cases involving cross references).  I'd like to remove these ifdefs.

BTW2, the wd driver recently lost its device driver attribute in
files.i386, and some hardware drivers (apm, atapi, clock, eisa, spkr)
never had this attribute.  The attribute seems to be used only for
generating possibly different compile options (${DRIVER_C} instead of
${NORMAL_C}) for device drivers.  Since these options are actually the
same, there is no problem in practice.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199509100344.NAA19536>