From owner-freebsd-standards@FreeBSD.ORG Fri Nov 28 21:56:21 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CF3AF16A4CE for ; Fri, 28 Nov 2003 21:56:21 -0800 (PST) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id B18D943FBD for ; Fri, 28 Nov 2003 21:56:20 -0800 (PST) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id hAT5uKEG006666; Fri, 28 Nov 2003 21:56:20 -0800 (PST) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) hAT5uJWx052524; Fri, 28 Nov 2003 21:56:20 -0800 (PST) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.10/8.12.10/Submit) id hAT5uJrL052511; Fri, 28 Nov 2003 21:56:19 -0800 (PST) (envelope-from marcel) Date: Fri, 28 Nov 2003 21:56:19 -0800 From: Marcel Moolenaar To: Bruce Evans Message-ID: <20031129055619.GA48381@dhcp01.pn.xcllnt.net> References: <20031129005823.GA20090@dhcp01.pn.xcllnt.net> <20031129161509.J4841@gamplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031129161509.J4841@gamplex.bde.org> User-Agent: Mutt/1.5.4i cc: standards@freebsd.org Subject: Re: 64-bit NULL: a followup X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Nov 2003 05:56:21 -0000 On Sat, Nov 29, 2003 at 04:39:14PM +1100, Bruce Evans wrote: > > > So, the bottomline is that we currently do have third-party code that > > fails to run on ia64 (and possibly other 64-bit platforms) due to the > > fact that NULL is defined as 0. > > > > Since Erik thinks 0 and 0L are both perfectly good definitions for > > NULL and Tony emphasizes that NULL is an integer expression, I think > ^^ may be > > we should change the definition of NULL to 0L to improve portability > > to FreeBSD/LP64. It will definitely fix known breakages on ia64. > > This would be bogus. Long doesn't have the same width as `void *' on all > machines. The bogusness doesn't increase if we're looking at widths. It actually reduces. The FreeBSD runtime is either ILP32 or LP64. Hence, defining NULL as long is better than defining it as int. For those running IP32L64, NULL can trivially be redefined as int. > ((void *)0) is better, but I wouldn't change it, except > locally to trap errors. Ok, so what is better (void*)0 or 0L? -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net