On 9/7/08, Nicolas Martyanoff <[EMAIL PROTECTED]> wrote:
> If NULL expands to 0, then basic logic tells me that the null pointer
> constant is 0; if I'm making a logic error, what is it ?

you expect that the symbol '0' means the same for integers and
pointers, but it's not

(as i wrote earlier: integer 0 is 'all-bits-zero', thus memset works,
but pointer 0 is not required to be 'all-bits-zero', it just *happens
to be* 'all-bits-zero' on every sane platform)

> The standard contains ambiguities, everybody knows that; if K&R 2 tells

no the standard is very precise about this.

> struct foo bar;
> memset(&bar, 0, sizeof(struct foo));
>
> Will get bar.i == 0, and foo.ptr == NULL.

not guaranteed by the standard

Reply via email to