Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Aug 2002 22:31:01 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Garrett Wollman <wollman@lcs.mit.edu>
Cc:        archie@dellroad.org, <arch@FreeBSD.ORG>
Subject:   Re: NULL
Message-ID:  <20020822221905.H3508-100000@gamplex.bde.org>
In-Reply-To: <200208220245.g7M2jD8A004461@khavrinen.lcs.mit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020822221905.H3508-100000>