]> granicus.if.org Git - clang/commitdiff
Add a flag to control the "indirection of non-volatile null pointer will be
authorNick Lewycky <nicholas@mxc.ca>
Fri, 3 Dec 2010 01:10:02 +0000 (01:10 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Fri, 3 Dec 2010 01:10:02 +0000 (01:10 +0000)
deleted, not trap" warning. Fixed PR8729. Patch by Elias Pipping!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120771 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticGroups.td
include/clang/Basic/DiagnosticSemaKinds.td

index 711380fa39b7005264cb514169aade45140fd8f2..92b29b2c9844fc6e2a8f8d2d4f7111d422965878 100644 (file)
@@ -75,6 +75,7 @@ def : DiagGroup<"newline-eof">;
 def LongLong : DiagGroup<"long-long">;
 def MismatchedTags : DiagGroup<"mismatched-tags">;
 def MissingFieldInitializers : DiagGroup<"missing-field-initializers">;
+def NullDereference : DiagGroup<"null-dereference">;
 def InitializerOverrides : DiagGroup<"initializer-overrides">;
 def NonNull : DiagGroup<"nonnull">;
 def : DiagGroup<"nonportable-cfstrings">;
index 6945c17b927e3ecd2b3217006c3bf6a9f162f8f4..d3c1a50a668e05607f0cb288ea0dc3fc938e796a 100644 (file)
@@ -2295,7 +2295,7 @@ def err_typecheck_unary_expr : Error<
 def err_typecheck_indirection_requires_pointer : Error<
   "indirection requires pointer operand (%0 invalid)">;
 def warn_indirection_through_null : Warning<
-  "indirection of non-volatile null pointer will be deleted, not trap">;
+  "indirection of non-volatile null pointer will be deleted, not trap">, InGroup<NullDereference>;
 def note_indirection_through_null : Note<
   "consider using __builtin_trap() or qualifying pointer with 'volatile'">;