From owner-freebsd-standards@FreeBSD.ORG Sat Nov 29 05:40:52 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 2175F16A4CE for ; Sat, 29 Nov 2003 05:40:52 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 285B643FEC for ; Sat, 29 Nov 2003 05:40:50 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id AAA32381; Sun, 30 Nov 2003 00:40:41 +1100 Date: Sun, 30 Nov 2003 00:40:41 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Marcel Moolenaar In-Reply-To: <20031129055619.GA48381@dhcp01.pn.xcllnt.net> Message-ID: <20031130003519.M1415@gamplex.bde.org> References: <20031129005823.GA20090@dhcp01.pn.xcllnt.net> <20031129055619.GA48381@dhcp01.pn.xcllnt.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 13:40:52 -0000 On Fri, 28 Nov 2003, Marcel Moolenaar wrote: > On Sat, Nov 29, 2003 at 04:39:14PM +1100, Bruce Evans wrote: > > > 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. It could be MD in all cases to hide bugs in a MD way. > > ((void *)0) is better, but I wouldn't change it, except > > locally to trap errors. > > Ok, so what is better (void*)0 or 0L? I thought the former, but forgot about C++. There could be ugly ifdefs for this. Bruce