2017-07-14 20:15:55 +08:00
|
|
|
set(LLVM_LINK_COMPONENTS support)
|
|
|
|
|
|
|
|
add_clang_library(clangTidyBugproneModule
|
2017-11-24 01:02:48 +08:00
|
|
|
ArgumentCommentCheck.cpp
|
2017-11-24 22:16:29 +08:00
|
|
|
AssertSideEffectCheck.cpp
|
|
|
|
BoolPointerImplicitConversionCheck.cpp
|
2017-07-14 20:15:55 +08:00
|
|
|
BugproneTidyModule.cpp
|
2017-11-17 20:23:30 +08:00
|
|
|
CopyConstructorInitCheck.cpp
|
2017-11-24 17:52:05 +08:00
|
|
|
DanglingHandleCheck.cpp
|
2018-07-13 21:09:40 +08:00
|
|
|
ExceptionEscapeCheck.cpp
|
2017-11-24 22:16:29 +08:00
|
|
|
FoldInitTypeCheck.cpp
|
|
|
|
ForwardDeclarationNamespaceCheck.cpp
|
2018-02-28 22:47:20 +08:00
|
|
|
ForwardingReferenceOverloadCheck.cpp
|
2017-11-24 22:16:29 +08:00
|
|
|
InaccurateEraseCheck.cpp
|
2018-01-30 23:12:24 +08:00
|
|
|
IncorrectRoundingsCheck.cpp
|
2017-08-10 21:30:30 +08:00
|
|
|
IntegerDivisionCheck.cpp
|
2018-02-28 22:47:20 +08:00
|
|
|
LambdaFunctionNameCheck.cpp
|
2018-03-15 16:25:39 +08:00
|
|
|
MacroParenthesesCheck.cpp
|
2018-02-28 22:47:20 +08:00
|
|
|
MacroRepeatedSideEffectsCheck.cpp
|
2017-11-23 20:26:28 +08:00
|
|
|
MisplacedOperatorInStrlenInAllocCheck.cpp
|
2018-02-28 22:47:20 +08:00
|
|
|
MisplacedWideningCastCheck.cpp
|
2017-11-24 22:16:29 +08:00
|
|
|
MoveForwardingReferenceCheck.cpp
|
|
|
|
MultipleStatementMacroCheck.cpp
|
2018-04-07 04:02:50 +08:00
|
|
|
ParentVirtualCallCheck.cpp
|
2018-03-15 16:26:47 +08:00
|
|
|
SizeofContainerCheck.cpp
|
2018-03-15 16:26:19 +08:00
|
|
|
SizeofExpressionCheck.cpp
|
2017-11-23 21:49:14 +08:00
|
|
|
StringConstructorCheck.cpp
|
2018-03-01 07:30:29 +08:00
|
|
|
StringIntegerAssignmentCheck.cpp
|
|
|
|
StringLiteralWithEmbeddedNulCheck.cpp
|
|
|
|
SuspiciousEnumUsageCheck.cpp
|
2017-07-14 20:15:55 +08:00
|
|
|
SuspiciousMemsetUsageCheck.cpp
|
2018-03-01 07:30:29 +08:00
|
|
|
SuspiciousMissingCommaCheck.cpp
|
2018-03-01 07:47:15 +08:00
|
|
|
SuspiciousSemicolonCheck.cpp
|
|
|
|
SuspiciousStringCompareCheck.cpp
|
|
|
|
SwappedArgumentsCheck.cpp
|
2018-05-14 18:10:02 +08:00
|
|
|
TerminatingContinueCheck.cpp
|
2018-02-15 17:08:51 +08:00
|
|
|
ThrowKeywordMissingCheck.cpp
|
[clang-tidy] new check: bugprone-too-small-loop-variable
The new checker searches for those for loops which has a loop variable with a "too small" type which means this type can't represent all values which are part of the iteration range.
For example:
```
int main() {
long size = 300000;
for( short int i = 0; i < size; ++i) {}
}
```
The short type leads to infinite loop here because it can't store all values in the `[0..size]` interval. In a real use case, size means a container's size which depends on the user input. Which means for small amount of objects the algorithm works, but with a larger user input the software will freeze.
The idea of the checker comes from the LibreOffice project, where the same check was implemented as a clang compiler plugin, called `LoopVarTooSmall` (LLVM licensed).
The idea is the same behind this check, but the code is different because of the different framework.
Patch by ztamas.
Reviewers: alexfh, hokein, aaron.ballman, JonasToth, xazax.hun, whisperity
Reviewed By: JonasToth, whisperity
Differential Revision: https://reviews.llvm.org/D53974
llvm-svn: 346665
2018-11-13 00:01:39 +08:00
|
|
|
TooSmallLoopVariableCheck.cpp
|
2017-07-14 20:20:19 +08:00
|
|
|
UndefinedMemoryManipulationCheck.cpp
|
2018-03-01 07:47:15 +08:00
|
|
|
UndelegatedConstructorCheck.cpp
|
2018-03-15 16:27:42 +08:00
|
|
|
UnusedRaiiCheck.cpp
|
2018-03-19 21:02:32 +08:00
|
|
|
UnusedReturnValueCheck.cpp
|
2017-11-24 22:16:29 +08:00
|
|
|
UseAfterMoveCheck.cpp
|
|
|
|
VirtualNearMissCheck.cpp
|
2017-07-14 20:15:55 +08:00
|
|
|
|
|
|
|
LINK_LIBS
|
|
|
|
clangAnalysis
|
|
|
|
clangAST
|
|
|
|
clangASTMatchers
|
|
|
|
clangBasic
|
|
|
|
clangLex
|
|
|
|
clangTidy
|
2018-05-23 15:58:41 +08:00
|
|
|
clangTidyCppCoreGuidelinesModule
|
2017-07-14 20:15:55 +08:00
|
|
|
clangTidyUtils
|
|
|
|
clangTooling
|
|
|
|
)
|