[PATCH] clean up compiler warnings in 2.5 bk

Nathan Lynch nathanl at austin.ibm.com
Fri Nov 14 06:37:24 EST 2003


Paul Mackerras wrote:
>>-        if (np->node != NULL) {
>>+        if (np->node) {
>
>
> Why do you consider the + version to be better?  I prefer the != NULL
> form myself.  If the compiler is warning about that then the compiler
> is broken and we should get it fixed.

I prefer it because use of NULL implies that np->node is a pointer,
which it is not.  The compiler's warning seems valid to me.

Anyway, both gcc 3.2.1 and 3.3.2 produce the warning.  If you prefer
explicit comparison, here is a patch that replaces NULL with 0.

Nathan
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: warning_cleanup.patch
Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20031113/6e0941f0/attachment.txt 


More information about the Linuxppc64-dev mailing list