From owner-freebsd-arch Wed Aug 21 16:37: 7 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 32A8237B400 for ; Wed, 21 Aug 2002 16:37:03 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 34BEF43E4A for ; Wed, 21 Aug 2002 16:37:02 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.3/8.12.3) with ESMTP id g7LNauFl025645; Wed, 21 Aug 2002 17:36:57 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Wed, 21 Aug 2002 17:36:53 -0600 (MDT) Message-Id: <20020821.173653.57449387.imp@bsdimp.com> To: archie@dellroad.org Cc: freebsd-arch@FreeBSD.ORG Subject: Re: NULL From: "M. Warner Losh" In-Reply-To: <200208212322.g7LNMcc08044@arch20m.dellroad.org> References: <20020821.003628.52042275.imp@bsdimp.com> <200208212322.g7LNMcc08044@arch20m.dellroad.org> X-Mailer: Mew version 2.1 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message: <200208212322.g7LNMcc08044@arch20m.dellroad.org> Archie Cobbs 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