9#include "../ClangTidy.h"
10#include "../ClangTidyModule.h"
11#include "../ClangTidyModuleRegistry.h"
12#include "../bugprone/BadSignalToKillThreadCheck.h"
13#include "../bugprone/PointerArithmeticOnPolymorphicObjectCheck.h"
14#include "../bugprone/ReservedIdentifierCheck.h"
15#include "../bugprone/SignalHandlerCheck.h"
16#include "../bugprone/SignedCharMisuseCheck.h"
17#include "../bugprone/SizeofExpressionCheck.h"
18#include "../bugprone/SpuriouslyWakeUpFunctionsCheck.h"
19#include "../bugprone/SuspiciousMemoryComparisonCheck.h"
20#include "../bugprone/UnhandledSelfAssignmentCheck.h"
21#include "../bugprone/UnsafeFunctionsCheck.h"
22#include "../bugprone/UnusedReturnValueCheck.h"
23#include "../concurrency/ThreadCanceltypeAsynchronousCheck.h"
24#include "../google/UnnamedNamespaceInHeaderCheck.h"
25#include "../misc/NewDeleteOverloadsCheck.h"
26#include "../misc/NonCopyableObjects.h"
27#include "../misc/StaticAssertCheck.h"
28#include "../misc/ThrowByValueCatchByReferenceCheck.h"
29#include "../performance/MoveConstructorInitCheck.h"
30#include "../readability/EnumInitialValueCheck.h"
31#include "../readability/UppercaseLiteralSuffixCheck.h"
53const llvm::StringRef CertErr33CCheckedFunctions =
"^::aligned_alloc;"
339 Opts[
"cert-arr39-c.WarnOnSizeOfConstant"] =
"false";
340 Opts[
"cert-arr39-c.WarnOnSizeOfIntegerExpression"] =
"false";
341 Opts[
"cert-arr39-c.WarnOnSizeOfThis"] =
"false";
342 Opts[
"cert-arr39-c.WarnOnSizeOfCompareToConstant"] =
"false";
343 Opts[
"cert-arr39-c.WarnOnSizeOfPointer"] =
"false";
344 Opts[
"cert-arr39-c.WarnOnSizeOfPointerToAggregate"] =
"false";
345 Opts[
"cert-dcl16-c.NewSuffixes"] =
"L;LL;LU;LLU";
346 Opts[
"cert-err33-c.CheckedFunctions"] = CertErr33CCheckedFunctions;
347 Opts[
"cert-err33-c.AllowCastToVoid"] =
"true";
348 Opts[
"cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField"] =
"false";
349 Opts[
"cert-str34-c.DiagnoseSignedUnsignedCharComparisons"] =
"false";
357static ClangTidyModuleRegistry::Add<cert::CERTModule>
359 "Adds lint checks corresponding to CERT secure coding guidelines.");
A collection of ClangTidyCheckFactory instances.
void registerCheck(llvm::StringRef CheckName)
Registers the CheckType with the name Name.
A clang-tidy module groups a number of ClangTidyChecks and gives them a prefixed name.
Finds pthread_kill function calls when thread is terminated by SIGTERM signal.
Finds pointer arithmetic performed on classes that contain a virtual function.
Checks for usages of identifiers reserved for use by the implementation.
Checker for signal handler functions.
Finds those signed char -> integer conversions which might indicate a programming error.
Find suspicious usages of sizeof expressions.
Finds cnd_wait, cnd_timedwait, wait, wait_for, or wait_until function calls when the function is not ...
Finds potentially incorrect calls to memcmp() based on properties of the arguments.
Finds user-defined copy assignment operators which do not protect the code against self-assignment ei...
Checks for functions that have safer, more secure replacements available, or are considered deprecate...
Detects function calls where the return value is unused.
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override
Implement this function in order to register all CheckFactories belonging to this module.
ClangTidyOptions getModuleOptions() override
Gets default options for checks defined in this module.
Execution of a command processor can lead to security vulnerabilities, and is generally not required.
Checks if an object of type with extended alignment is allocated by using the default operator new.
Modification of the std or posix namespace can result in undefined behavior.
This check diagnoses when the loop induction expression of a for loop has floating-point type.
Pseudorandom number generators are not genuinely random.
Finds assignments to the copied object and its direct or indirect members in copy constructors and co...
Flags use of the C standard library functions 'memset', 'memcpy' and 'memcmp' and similar derivatives...
Random number generator must be seeded properly.
Guards against use of setjmp/longjmp in C++ code.
Checks whether the constructor for a static or thread_local object will throw.
Guards against use of string conversion functions that do not have reasonable error handling for conv...
Checks whether a thrown object is nothrow copy constructible.
Guards against any C-style variadic function definitions (not declarations).
Finds pthread_setcanceltype function calls where a thread's cancellation type is set to asynchronous.
The check flags dereferences and non-pointer declarations of objects that are not meant to be passed ...
Replaces assert() with static_assert() if the condition is evaluatable at compile time.
checks for locations that do not throw by value
Enforces consistent style for enumerators' initialization, covering three styles: none,...
Detects when the integral literal or floating point literal has non-uppercase suffix,...
volatile int CERTModuleAnchorSource
Contains options for clang-tidy.
OptionMap CheckOptions
Key-value mapping used to store check-specific options.
llvm::StringMap< ClangTidyValue > OptionMap