From owner-freebsd-arch Thu Aug 22 5:25:42 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 DCDD437B408 for ; Thu, 22 Aug 2002 05:25:27 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 01B8343E6A for ; Thu, 22 Aug 2002 05:25:26 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id MAA18596; Thu, 22 Aug 2002 12:25:01 GMT Date: Thu, 22 Aug 2002 22:31:01 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Garrett Wollman Cc: archie@dellroad.org, Subject: Re: NULL In-Reply-To: <200208220245.g7M2jD8A004461@khavrinen.lcs.mit.edu> Message-ID: <20020822221905.H3508-100000@gamplex.bde.org> MIME-Version: 1.0 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 On Wed, 21 Aug 2002, Garrett Wollman wrote: > In article <200208212358.g7LNw8l08243@arch20m.dellroad.org> you write: > >Seems like the same is true of "0".. e.g., suppose that pointers > >are larger than integers, and you call a variadic function with > >"NULL" as one of the extra parameters: > > > > printf("foo=%p num=%d\n", NULL, 123); > > > >This would get screwed with NULL=0 but work right with NULL=(void *)0. > > That's a feature. (Unfortunately, this feature is not implemented on > ILP32 architectures. Is 0LL allowed as a null pointer constant? That > would break everyone equally in this case.) I think it is not implemented on many I32LP64 arches either, since most arches with 64-bit pointers have pass all args as 64-bit. Everything between ((signed char)0) and ((uintmax_t)0) is allowed. uintmax_t would have to be > 64 bits to break the 64-bit arches equally. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message