On Fri, Feb 24, 2012 at 09:58:47AM +0000, Carlos R. Mafra wrote:
> On Fri, 24 Feb 2012 at  1:21:58 -0800, Doug Barton wrote:
> >
> > Use logical negation instead of comparison to 0 for a value that can
> > be numeric, but is null by default.
> 
> This doesn't seem to be right.
> 
> 'restarting' is not a pointer, it is a 'int'. If checking a int 
> against zero is not allowed than you'd have many more things to
> worry about, no?

And further, while the general case of comparing a pointer with an
integer in C is undefined behavior, the special case of comparing a
pointer with an integer constant with the value 0 *is* valid, because an
integer constant with the value 0 is also the "null pointer constant"
(even if the NULL pointer isn't actually all-bits-zero).


-- 
To unsubscribe, send mail to [email protected].

Reply via email to