[cfe-commits] Patch: Add a warning for NULL used in arithmetic operations

Chandler Carruth chandlerc at google.com
Thu May 26 03:10:57 PDT 2011

On Mon, May 2, 2011 at 5:48 PM, Richard Trieu <rtrieu at google.com> wrote:

> Add warning when NULL constant value is used improperly in expressions.
Some high-level comments:

1) Why only handle GNUNull null-pointer-constants? I think there is a good
reason here (making them behave as much like nullptr as possible) but it
would be good to document that in comments at least.

2) What drives the set of invalid operations? I assume its those that
nullptr would be invalid for? If so, can you provide standard citations
against the draft standard? Also, is there no way to just turn on the C++0x
errors for nullptr when we see the GNUNull in C++03, but down-grade them to

3) Because these are warnings, we can't return ExprError; that changes the
parse result.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110526/7b46c6b1/attachment.html>

More information about the cfe-commits mailing list