tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: definition of NULL correct?



On Wed, Aug 12, 2009 at 12:38 AM, der 
Mouse<mouse%rodents-montreal.org@localhost> wrote:
>> Why not, given that "sizeof 10" works, and NULL is ultimately
>> supposed to be just another constant expression?
>
> For the same reason that "sizeof (float)(2+3)", or "sizeof (int)10" (to
> tweak your exmaple) doesn't work, even though (float)(2+3) and (int)10
> are just as much "just another constant expression".
>
"sizeof (float)(2+3)" is not C99 for the reason highlighted by uwe@.

>> Whether the value it generates is useful is a different matter... :-)
> Yeah.  The only use I've been able to think of for it is to allow
> probing whether the local system uses the integer option or the
> pointer-to-void option for NULL on systems where they have different
> sizes.
>
we are talking syntax, not usefulness.

 - Arnaud


Home | Main Index | Thread Index | Old Index