]> granicus.if.org Git - clang/commitdiff
Put the new warning from revision 133196 on NULL arithmetic behind the flag -Wnull...
authorRichard Trieu <rtrieu@google.com>
Fri, 17 Jun 2011 20:35:48 +0000 (20:35 +0000)
committerRichard Trieu <rtrieu@google.com>
Fri, 17 Jun 2011 20:35:48 +0000 (20:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133287 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticSemaKinds.td
test/SemaCXX/null_in_arithmetic_ops.cpp
test/SemaObjCXX/null_objc_pointer.mm

index 66d940cab919420dbde9744aaa49886ff28f7527..f28dd1e49a828c1448d4d749b743abb83482c748 100644 (file)
@@ -2998,7 +2998,8 @@ def warn_comparison_of_mixed_enum_types : Warning<
   "comparison of two values with different enumeration types (%0 and %1)">,
   InGroup<DiagGroup<"enum-compare">>;
 def warn_null_in_arithmetic_operation : Warning<
-  "use of NULL in arithmetic operation">;
+  "use of NULL in arithmetic operation">,
+  InGroup<DiagGroup<"null-arithmetic">>, DefaultIgnore;
 
 def err_invalid_this_use : Error<
   "invalid use of 'this' outside of a nonstatic member function">;
index 547c936c3e558fd2108f677af3e7e8aee23150c0..b0303177c259f3e054fb08fef7927f9946c78456 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -fblocks -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fblocks -Wnull-arithmetic -verify %s
 #include <stddef.h>
 
 void f() {
index 1dadabef29994fcc373f66f6bde89f1220442e5e..0da9e50f5a1cbe0a91bcc6ffb3c1cff325d2855b 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wnull-arithmetic %s
 #define NULL __null
 
 @interface X