1 .. title:: clang-tidy - cert-oop57-cpp
6 Flags use of the `C` standard library functions ``memset``, ``memcpy`` and
7 ``memcmp`` and similar derivatives on non-trivial types.
12 .. option:: MemSetNames
14 Specify extra functions to flag that act similarly to ``memset``.
15 Specify names in a semicolon delimited list.
16 Default is an empty string.
17 The check will detect the following functions:
18 `memset`, `std::memset`.
20 .. option:: MemCpyNames
22 Specify extra functions to flag that act similarly to ``memcpy``.
23 Specify names in a semicolon delimited list.
24 Default is an empty string.
25 The check will detect the following functions:
26 `std::memcpy`, `memcpy`, `std::memmove`, `memmove`, `std::strcpy`,
27 `strcpy`, `memccpy`, `stpncpy`, `strncpy`.
29 .. option:: MemCmpNames
31 Specify extra functions to flag that act similarly to ``memcmp``.
32 Specify names in a semicolon delimited list.
33 Default is an empty string.
34 The check will detect the following functions:
35 `std::memcmp`, `memcmp`, `std::strcmp`, `strcmp`, `strncmp`.
37 This check corresponds to the CERT C++ Coding Standard rule
38 `OOP57-CPP. Prefer special member functions and overloaded operators to C
39 Standard Library functions
40 <https://wiki.sei.cmu.edu/confluence/display/cplusplus/OOP57-CPP.+Prefer+special+member+functions+and+overloaded+operators+to+C+Standard+Library+functions>`_.