From a427b49f99bd2416731de0d4f8bdec12b4807e7c Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Fri, 3 Dec 2010 01:10:02 +0000 Subject: [PATCH] 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 --- include/clang/Basic/DiagnosticGroups.td | 1 + include/clang/Basic/DiagnosticSemaKinds.td | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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'">; -- 2.40.0