"Andrew Pinski" <[EMAIL PROTECTED]> writes:

> On Jan 30, 2008 7:38 PM, Dongsheng Song <[EMAIL PROTECTED]> wrote:
>> See: http://www.linuxonly.nl/docs/2/0_Page_1.html
>
> It says:
> This is because NULL is not of the right type: it is defined as
> integer 0 instead of a pointer with the value 0.
>
> Except that is wrong from what the C99 standard says about the NULL macro:
> The macros are
> NULL
> which expands to an implementation-defined null pointer constant

And 0 is a valid null pointer constant.

> So no casting is needed as it is already a pointer type if we follow
> the C99 standard (I think C90 says the same thing except I don't have
> C90 in front of me).

A null pointer constant is _not_ a pointer.  It is only becomes a
pointer when explicitly or implicitly converted to one.  Neither is the
case here.

Andreas.

-- 
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Reply via email to