http://codereview.appspot.com/4861041/diff/1/include/clang/Basic/DiagnosticSemaKinds.td File include/clang/Basic/DiagnosticSemaKinds.td (right): http://codereview.appspot.com/4861041/diff/1/include/clang/Basic/DiagnosticSemaKinds.td#newcode3168 include/clang/Basic/DiagnosticSemaKinds.td:3168: "%select{(%1 and NULL)|(NULL and %1)}0">, On 2011/08/11 01:32:14, chandlerc ...
13 years, 3 months ago
(2011-08-11 01:44:30 UTC)
#2
http://codereview.appspot.com/4861041/diff/1/include/clang/Basic/DiagnosticSe...
File include/clang/Basic/DiagnosticSemaKinds.td (right):
http://codereview.appspot.com/4861041/diff/1/include/clang/Basic/DiagnosticSe...
include/clang/Basic/DiagnosticSemaKinds.td:3168: "%select{(%1 and NULL)|(NULL
and %1)}0">,
On 2011/08/11 01:32:14, chandlerc wrote:
> Why repeat the NULL here? Maybe just "... between NULL and non-pointer %1'.
Also
> I wonder if we want to spell NULL the way the user did (NULL vs. (void*)0 vs.
> nullptr).
The NULL is repeated since many other warnings on binary operations will have
('type1' and 'type2') so this is to be consistent with them.
This warning checks for a GNUNullExpr, so it won't trigger on (void*)0 or
nullptr. In those cases, a separate error will be emitted. I believe it will
trigger on __null, but I don't think that is commonly used.
Issue 4861041: Make a more descriptive warning when comparing NULL with non-pointer
(Closed)
Created 13 years, 3 months ago by rtrieu
Modified 13 years, 3 months ago
Reviewers: chandlerc
Base URL: https://llvm.org/svn/llvm-project/cfe/trunk/
Comments: 2