diff options
author | Richard Trieu <rtrieu@google.com> | 2011-06-17 20:35:48 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2011-06-17 20:35:48 +0000 |
commit | 4e938df04897ebc196d92b4f7f77b19f204e9d24 (patch) | |
tree | 5a87d58e7a976f77cec70afa5cb49b6d7aeb0dbf | |
parent | 12189f573f5dafb7fa33e8dc32ff06cd6fd35963 (diff) |
Put the new warning from revision 133196 on NULL arithmetic behind the flag -Wnull-arthimetic and set to DefaultIgnore. A few edge cases need to be worked out before this can be set to default.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133287 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 3 | ||||
-rw-r--r-- | test/SemaCXX/null_in_arithmetic_ops.cpp | 2 | ||||
-rw-r--r-- | test/SemaObjCXX/null_objc_pointer.mm | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 66d940cab9..f28dd1e49a 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -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">; diff --git a/test/SemaCXX/null_in_arithmetic_ops.cpp b/test/SemaCXX/null_in_arithmetic_ops.cpp index 547c936c3e..b0303177c2 100644 --- a/test/SemaCXX/null_in_arithmetic_ops.cpp +++ b/test/SemaCXX/null_in_arithmetic_ops.cpp @@ -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() { diff --git a/test/SemaObjCXX/null_objc_pointer.mm b/test/SemaObjCXX/null_objc_pointer.mm index 1dadabef29..0da9e50f5a 100644 --- a/test/SemaObjCXX/null_objc_pointer.mm +++ b/test/SemaObjCXX/null_objc_pointer.mm @@ -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 |