[PATCH] D130470: [clang][analyzer] Add more wide-character functions to CStringChecker

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 29 00:19:49 PDT 2022


steakhal added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp:136-137
       {{CDF_MaybeBuiltin, "memcpy", 3},
-       std::bind(&CStringChecker::evalMemcpy, _1, _2, _3, false)},
+       std::bind(&CStringChecker::evalMemcpy, _1, _2, _3,
+                 CharacterKind::Regular)},
       {{CDF_MaybeBuiltin, "wmemcpy", 3},
----------------
If you were using a plain-old enum, it would feel less repetitive.
You are already in the anonymous namespace, so it would not pollute anything anyway.
You could also `use std::bind`, to make it denser.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp:179
+                 CharacterKind::Regular)},
+      //{{CDF_MaybeBuiltin, "bcmp", 3}, &CStringChecker::evalMemcmp},
       {{CDF_MaybeBuiltin, "bzero", 2}, &CStringChecker::evalBzero},
----------------
This line looks dead.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130470/new/

https://reviews.llvm.org/D130470



More information about the cfe-commits mailing list