#include "../ClangTidyModuleRegistry.h"
#include "CopyConstructorInitCheck.h"
#include "IntegerDivisionCheck.h"
+#include "MisplacedOperatorInStrlenInAllocCheck.h"
#include "SuspiciousMemsetUsageCheck.h"
#include "UndefinedMemoryManipulationCheck.h"
"bugprone-copy-constructor-init");
CheckFactories.registerCheck<IntegerDivisionCheck>(
"bugprone-integer-division");
+ CheckFactories.registerCheck<MisplacedOperatorInStrlenInAllocCheck>(
+ "bugprone-misplaced-operator-in-strlen-in-alloc");
CheckFactories.registerCheck<SuspiciousMemsetUsageCheck>(
"bugprone-suspicious-memset-usage");
CheckFactories.registerCheck<UndefinedMemoryManipulationCheck>(
BugproneTidyModule.cpp
CopyConstructorInitCheck.cpp
IntegerDivisionCheck.cpp
+ MisplacedOperatorInStrlenInAllocCheck.cpp
SuspiciousMemsetUsageCheck.cpp
UndefinedMemoryManipulationCheck.cpp
not intended to be subclassed. Includes a list of classes from Foundation
and UIKit which are documented as not supporting subclassing.
+- New `bugprone-misplaced-operator-in-strlen-in-alloc
+ <http://clang.llvm.org/extra/clang-tidy/checks/bugprone-misplaced-operator-in-strlen-in-alloc.html>`_ check
+
+ Finds cases where ``1`` is added to the string in the argument to
+ ``strlen()``, ``strnlen()``, ``strnlen_s()``, ``wcslen()``, ``wcsnlen()``, and
+ ``wcsnlen_s()`` instead of the result and the value is used as an argument to
+ a memory allocation function (``malloc()``, ``calloc()``, ``realloc()``,
+ ``alloca()``).
+
- Renamed checks to use correct term "implicit conversion" instead of "implicit
cast" and modified messages and option names accordingly:
boost-use-to-string
bugprone-copy-constructor-init
bugprone-integer-division
+ bugprone-misplaced-operator-in-strlen-in-alloc
bugprone-suspicious-memset-usage
bugprone-undefined-memory-manipulation
cert-dcl03-c (redirects to misc-static-assert) <cert-dcl03-c>