[PATCH] D48866: [clang-tidy] Add incorrect-pointer-cast checker

Eugene Zelenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 3 08:16:45 PDT 2018


Eugene.Zelenko added a comment.

//bugprone// seems to be proper category for this check.



================
Comment at: clang-tidy/misc/IncorrectPointerCastCheck.cpp:35
+  const ASTContext &Context = *Result.Context;
+  const CStyleCastExpr *CastExpr =
+      Result.Nodes.getNodeAs<CStyleCastExpr>("cast");
----------------
const auto * could be used instead.


================
Comment at: clang-tidy/misc/IncorrectPointerCastCheck.h:19
+
+/// This checker warns for cases when pointer is cast and the pointed to type is
+/// incompatible with allocated memory area type. This may lead to access memory
----------------
Please make sentence same as in Release Notes. 


================
Comment at: docs/clang-tidy/checks/misc-incorrect-pointer-cast.rst:6
+
+This checker warns for cases when pointer is cast and the pointed to type is
+incompatible with allocated memory area type. This may lead to access memory 
----------------
Please make this sentence same as in Release Notes.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D48866





More information about the cfe-commits mailing list