[PATCH] D32700: [clang-tidy] Add bugprone-suspicious-memset-usage check.

Whisperity via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 14 04:18:41 PDT 2017


whisperity added inline comments.


================
Comment at: clang-tidy/bugprone/SuspiciousMemsetUsageCheck.cpp:57-58
+void SuspiciousMemsetUsageCheck::check(const MatchFinder::MatchResult &Result) {
+  // Case 1: fill_char of memset() is a character '0'. Probably an integer zero
+  // was intended.
+  if (const auto *CharZeroFill =
----------------
@alexfh Your review on putting the comments within their applicable branch bodies applies here too?


================
Comment at: clang-tidy/bugprone/SuspiciousMemsetUsageCheck.cpp:89-90
+
+  // Case 3: byte_count of memset() is zero. This is most likely an argument
+  // swap.
+  else if (const auto *Call = Result.Nodes.getNodeAs<CallExpr>("call")) {
----------------
Same as L57-58.


https://reviews.llvm.org/D32700





More information about the cfe-commits mailing list