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

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 4 09:53:13 PDT 2018

alexfh added a comment.

Some patterns are covered by compiler diagnostics: https://godbolt.org/g/HvsjnP. Is there any benefit in re-implementing them?

Comment at: clang-tidy/misc/IncorrectPointerCastCheck.cpp:60
+        diag(CastExpr->getLocStart(),
+             "Do not use C-style cast from %0 to %1! "
+             "Different type layout. Struct members are incompatible")
The style of the message differs from that of the other checks (and Clang warnings). Messages are not complete sentences and as such should not use capitalization, trailing periods etc. Also I would avoid imperatives and exclamation  marks. The message should use neutral tone and state what exactly is wrong with the code and why.

Comment at: test/clang-tidy/misc-incorrect-pointer-cast.cpp:109
\ No newline at end of file

"No newline at end of file". Please fix.

  rCTE Clang Tools Extra


More information about the cfe-commits mailing list