From: Nick Lewycky Date: Fri, 3 Dec 2010 01:10:02 +0000 (+0000) Subject: Add a flag to control the "indirection of non-volatile null pointer will be X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a427b49f99bd2416731de0d4f8bdec12b4807e7c;p=clang Add a flag to control the "indirection of non-volatile null pointer will be 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 --- diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td index 711380fa39..92b29b2c98 100644 --- a/include/clang/Basic/DiagnosticGroups.td +++ b/include/clang/Basic/DiagnosticGroups.td @@ -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">; diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 6945c17b92..d3c1a50a66 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -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; def note_indirection_through_null : Note< "consider using __builtin_trap() or qualifying pointer with 'volatile'">;