Martin D Kealey <martin@kurahaupo.gen.nz> writes:
> It follows that the following assertions are allowed to fail:
>
> intptr_t i = 0;
> assert((void*)i == (void*)0);
> void *p = 0;
> assert((intptr_t)p == 0);
(After removing the bogus "*" that got inserted.)
Yeah, it looks like that's correct; there doesn't seem to be a
requirement that
> intptr_t i = 0;
> (void*)i
yields a NULL pointer.
OTOH,
> intptr_t i = (intptr_t)(void*)0;
> (void*)i
should do so.
Though I'd recommend removing use of intptr_t if at all possible, since
it violates semantic categories.
Dale