1.. title:: clang-tidy - cert-oop57-cpp 2 3cert-oop57-cpp 4============== 5 6 Flags use of the `C` standard library functions ``memset``, ``memcpy`` and 7 ``memcmp`` and similar derivatives on non-trivial types. 8 9Options 10------- 11 12.. option:: MemSetNames 13 14 Specify extra functions to flag that act similarily 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`. 19 20.. option:: MemCpyNames 21 22 Specify extra functions to flag that act similarily 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`. 28 29.. option:: MemCmpNames 30 31 Specify extra functions to flag that act similarily 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`. 36 37This check corresponds to the CERT C++ Coding Standard rule 38`OOP57-CPP. Prefer special member functions and overloaded operators to C 39Standard 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>`_. 41