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

Richard Trieu rtrieu at google.com
Thu Aug 11 15:39:36 PDT 2011


Commited at r137377

On Thu, Aug 11, 2011 at 1:44 PM, Ted Kremenek <kremenek at apple.com> wrote:

> 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/7beb848b/attachment.html>


More information about the cfe-commits mailing list