From owner-freebsd-arch Tue Aug 20 20:30: 8 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 533B437B400; Tue, 20 Aug 2002 20:30:06 -0700 (PDT) Received: from InterJet.dellroad.org (adsl-63-194-81-26.dsl.snfc21.pacbell.net [63.194.81.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id BBC8143E3B; Tue, 20 Aug 2002 20:30:05 -0700 (PDT) (envelope-from archie@dellroad.org) Received: from arch20m.dellroad.org (arch20m.dellroad.org [10.1.1.20]) by InterJet.dellroad.org (8.9.1a/8.9.1) with ESMTP id UAA88840; Tue, 20 Aug 2002 20:24:14 -0700 (PDT) Received: (from archie@localhost) by arch20m.dellroad.org (8.11.6/8.11.6) id g7L3NTR04362; Tue, 20 Aug 2002 20:23:29 -0700 (PDT) (envelope-from archie) From: Archie Cobbs Message-Id: <200208210323.g7L3NTR04362@arch20m.dellroad.org> Subject: Re: NULL In-Reply-To: <20020821114425.Q26007-100000@gamplex.bde.org> "from Bruce Evans at Aug 21, 2002 12:10:47 pm" To: Bruce Evans Date: Tue, 20 Aug 2002 20:23:29 -0700 (PDT) Cc: Jon Mini , Archie Cobbs , obrien@FreeBSD.ORG, freebsd-arch@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL88 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII 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 Bruce Evans writes: > In C, 0 and ((void *)0) are just 2 of many different correct definitions > of NULL. They cause different warnings and error in broken code, so > it may be useful to try compiling with both in an attempt to detect > more errors. So my vote is for NULL = "((void *)0)" when compiling C code (and leaving "0" when compiling C++, which can easily be different). This will catch such obvious bugs as "strncmp(s, t, NULL)" which are not caught as it stands now... -Archie __________________________________________________________________________ Archie Cobbs * Packet Design * http://www.packetdesign.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message