Re: offsetof



On Fri, 30 Sep 2005 13:27:44 +0100, Flash Gordon wrote:

>darkknight wrote:
>
><snip stuff that seems about right>
>
>> The expression (type*)0 does NOT create a NULL pointer constant unless
>> the type of "type" is void i.e. it is (void*)0.
>
>Wrong. It explicitly IS a null pointer constant of the specified type.
>In fact, with (type*)0 the 0 is a null pointer constant and, at run
>time, it explicitly gives you a null pointer.

Please quote the relevant sections of the standard to support your
claim.

darkknight
.



Relevant Pages

  • Re: K&R2 , exercise 7.6
    ... char *buffer = NULL; ... NULL is a null pointer constant. ... similar issue should enable you to understand the null pointer assignments ...
    (comp.lang.c)
  • Re: segmentation fault on calloc
    ... > otherwise only the second element is initialized), ... of floating-point zero or a null pointer constant." ... calloc()) to double, you won't necessarily get back 0.0. ...
    (comp.unix.programmer)
  • Re: PIC PSP port bus contention
    ... darkknight wrote: ... > interrupt pin on the 8052 and the PIC software drives it high then low ... Prev by Date: ...
    (comp.arch.embedded)
  • Re: Implementation-defined null pointer constant?
    ... I don't expect the committee to spend any time on this. ... pointer constant simply by declaring ... benefit just by consistently using the NULL macro. ... Prev by Date: ...
    (comp.std.c)
  • Re: Ike Naar
    ... constant (or at least is "called" a null pointer constant) regardless ... assert; ...
    (comp.lang.c)