Date: Wed, 21 Aug 2002 17:36:53 -0600 (MDT) From: "M. Warner Losh" <imp@bsdimp.com> To: archie@dellroad.org Cc: freebsd-arch@FreeBSD.ORG Subject: Re: NULL Message-ID: <20020821.173653.57449387.imp@bsdimp.com> In-Reply-To: <200208212322.g7LNMcc08044@arch20m.dellroad.org> References: <20020821.003628.52042275.imp@bsdimp.com> <200208212322.g7LNMcc08044@arch20m.dellroad.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In message: <200208212322.g7LNMcc08044@arch20m.dellroad.org>
Archie Cobbs <archie@dellroad.org> writes:
: The patch makes 'make buildworld' and 'make buildkernel KERNCONF=LINT'
: work for me; fyi I have "NO_WERROR= YES" in /etc/make.conf.
:
: Does anyone have an objection to this patch?
Yes. I'm not sure that (void *)0 is the right thing to do. It can
cause other problems and mask a different set of bugs, especially when
you call functions that have no prototype in scope.
: At the minimum, I'd like to apply the fixes for the incorrect uses
: of 'NULL' where '0' is really meant.
Those I don't have an objection to those fixes, since I myself have
fixed some today :-)
: Index: sbin/restore/restore.c
I've already done this one.
: Index: sys/dev/syscons/scvtb.c
: Index: sys/dev/syscons/syscons.c
: Index: sys/i386/i386/busdma_machdep.c
: ===================================================================
: RCS file: /home/cvs/freebsd/src/sys/i386/i386/busdma_machdep.c,v
: retrieving revision 1.26
: diff -u -r1.26 busdma_machdep.c
: --- sys/i386/i386/busdma_machdep.c 19 Apr 2002 22:58:09 -0000 1.26
: +++ sys/i386/i386/busdma_machdep.c 21 Aug 2002 23:10:31 -0000
: @@ -571,7 +571,7 @@
: dmat->lowaddr,
: PAGE_SIZE,
: 0);
: - if (bpage->vaddr == NULL) {
: + if (bpage->vaddr == 0) {
: free(bpage, M_DEVBUF);
: break;
: }
This one is conceptually OK. The problem with most of the ones in the
kernel that you fixed are where we use an unsigned into to store an
address. NULL is natural for thse, but wrong by some readings of the
standard. I'm not sure we should be changing them.
Warner
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020821.173653.57449387.imp>
