[cfe-commits] [Patch] Change the warning in -Wnull-arithmetic to be more descriptive when comparing NULL with non-pointer

Ted Kremenek kremenek at apple.com
Thu Aug 11 13:44:26 PDT 2011


Looks great to me.

On Aug 10, 2011, at 6:09 PM, Richard Trieu wrote:

> The current warning in -Wnull-arithmetic for comparisons between NULL and non-pointers is not very helpful.  This patch will update the wording to be more helpful to users.
> 
> Old warning:
> 
> warning: use of NULL in arithmetic operation [-Wnull-arithmetic]
>   return 10 <= NULL;
>             ^  ~~~~
> 
> New warning:
> 
> warning: comparison between NULL and non-pointer ('int' and NULL) [-Wnull-arithmetic]
>   return 10 <= NULL;
>          ~~ ^  ~~~~
> 
> Patch attached and also available at http://codereview.appspot.com/4861041/
> <null_comparison_warning.patch>_______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110811/2a9633f7/attachment.html>


More information about the cfe-commits mailing list