[PATCH] D22391: [Sema] Add warning for implicitly casting a null constant to a non null pointer type
Jordan Rose via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 24 16:39:32 PST 2017
jordan_rose added inline comments.
================
Comment at: include/clang/Basic/DiagnosticGroups.td:290
def NullableToNonNullConversion : DiagGroup<"nullable-to-nonnull-conversion">;
+def NullConstToNonnull : DiagGroup<"null-const-to-nonnull">;
def NullabilityCompletenessOnArrays : DiagGroup<"nullability-completeness-on-arrays">;
----------------
Nitpick: Using "const" here makes me think of the qualifier. Is there a reason not to just spell out "constant"?
================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:8807
+ "implicitly casting a null constant to non-nullable pointer type %0">,
+ InGroup<NullConstToNonnull>, DefaultIgnore;
+
----------------
Why "DefaultIgnore"? This seems like a good warning to be on all the time.
https://reviews.llvm.org/D22391
More information about the cfe-commits
mailing list