From owner-freebsd-current@FreeBSD.ORG Mon Mar 1 05:17:31 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BE38E16A4CF for ; Mon, 1 Mar 2004 05:17:31 -0800 (PST) Received: from dignus.com (ip-64-32-254-102.dsl.iad.megapath.net [64.32.254.102]) by mx1.FreeBSD.org (Postfix) with ESMTP id 39B3A43D1F for ; Mon, 1 Mar 2004 05:17:31 -0800 (PST) (envelope-from rivers@dignus.com) Received: from lakes.dignus.com (lakes.dignus.com [10.0.0.3]) by dignus.com (8.12.8p1/8.12.8) with ESMTP id i21DH5R2027826; Mon, 1 Mar 2004 08:17:05 -0500 (EST) (envelope-from rivers@dignus.com) Received: (from rivers@localhost) by lakes.dignus.com (8.11.6/8.11.3) id i21DFvC95798; Mon, 1 Mar 2004 08:15:57 -0500 (EST) (envelope-from rivers) Date: Mon, 1 Mar 2004 08:15:57 -0500 (EST) From: Thomas David Rivers Message-Id: <200403011315.i21DFvC95798@lakes.dignus.com> To: current@freebsd.org, mark@grondar.org In-Reply-To: <200402291546.i1TFkZ0w070591@grimreaper.grondar.org> X-Spam-Status: No, hits=-7.1 required=5.0 tests=IN_REP_TO,QUOTED_EMAIL_TEXT,QUOTE_TWICE_1 version=2.50 X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) Subject: Re: NULL vs 0 vs 0L bikeshed time X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2004 13:17:31 -0000 > > 1) Please restrain the need to bikeshed this one to death. I am > sympathetic to technical arguments, but compulsive noise over > such issues is annoying. > > 2) Please separate style disussion from technical discussion. > > I'd like to commit the following patch. It makes sure that for C > and the kernel, NULL is a ((void *)0), and for C++, NULL is either > (0L) or 0, with __LP64__ used to define the difference. > > The intent is to catch use of NULL where 0 or (0L) should be used. > It generates extra warnings (I promise to fix these). > I believe that _may_ be backwards; the C and C++ standards speak to this, and both of them have slightly different requirements. The C standard discuss the NULL constant, implying it is simply a zero (not necessarily cast to a pointer.) But - I believe (and I need to check on this) that the C++ standard requires the NULL constant to be a pointer type (so various conversions work.) So - before doing this; it might be nice to review the various standards to see if it's applicable. - Dave Rivers - -- rivers@dignus.com Work: (919) 676-0847 Get your mainframe programming tools at http://www.dignus.com