Re: Paying developers to get features faster

From: Casper H.S. Dik (Casper.Dik_at_Sun.COM)
Date: 01/25/04


Date: 25 Jan 2004 09:27:44 GMT

Brad Olin <bwo@bwo1.com> writes:

>Are you sure? The case I was referring to was a page mode address
>processor. Page zero, offset zero was a valid RAM address and you were
>allowed to point to it. That package defined NULL as something like...

>#define NULL const (void *)0x800000

I'm sure he is sure.

That's not a valid NULL pointer constant.

This looks like an implementer confusing the representation of
NULL and the NULL pointer constant; the implementation should
have worked like this:

        union {
                intptr_t nullval;
                void *null;
        } it;

        it.null = 0 /* or NULL, */
        printf("%lx\b", it.nullval); /* prints 0x800000 */

(assuming %lx is sufficient to represent a intptr_t

>My style is like yours. I try not to compare pointers, and if I do I
>limit myself to the defined NULL, never an assumed 0, the value 0, or to
>(void *)0. ymmv

Then you're assuming the possibility of a non conformant implementation.

Casper

-- 
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

Quantcast