[clang-tools-extra] [clang-tidy] Rename and move 'cert-oop57-cpp' to 'bugprone-raw-memory-call-on-non-trivial-type' (PR #162039)
Baranov Victor via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 22 07:22:27 PDT 2025
================
@@ -0,0 +1,40 @@
+.. title:: clang-tidy - bugprone-raw-memory-call-on-non-trivial-type
+
+bugprone-raw-memory-call-on-non-trivial-type
+============================================
+
+ Flags use of the C standard library functions ``memset``, ``memcpy`` and
+ ``memcmp`` and similar derivatives on non-trivial types.
+
+Options
+-------
+
+.. option:: MemSetNames
+
+ Specify extra functions to flag that act similarly to ``memset``.
+ Specify names in a semicolon delimited list.
+ Default is an empty string.
+ The check will detect the following functions:
----------------
vbvictor wrote:
Do we need to document these before options:
```
static const char BuiltinMemSet[] = "::std::memset;"
"::memset;";
static const char BuiltinMemCpy[] = "::std::memcpy;"
"::memcpy;"
"::std::memmove;"
"::memmove;"
"::std::strcpy;"
"::strcpy;"
"::memccpy;"
"::stpncpy;"
"::strncpy;";
static const char BuiltinMemCmp[] = "::std::memcmp;"
"::memcmp;"
```
And in options just write that new function could be specified in semicolon-delimited list. Default in an empty string.
https://github.com/llvm/llvm-project/pull/162039
More information about the cfe-commits
mailing list