2014-03-05 21:14:32 +08:00
|
|
|
set(LLVM_LINK_COMPONENTS support)
|
|
|
|
|
|
|
|
add_clang_library(clangTidyMiscModule
|
2017-04-06 17:56:42 +08:00
|
|
|
ForwardingReferenceOverloadCheck.cpp
|
2017-06-03 01:36:32 +08:00
|
|
|
LambdaFunctionNameCheck.cpp
|
2016-06-08 01:22:47 +08:00
|
|
|
MisplacedConstCheck.cpp
|
2016-05-04 20:02:22 +08:00
|
|
|
UnconventionalAssignOperatorCheck.cpp
|
2016-01-09 00:37:11 +08:00
|
|
|
DefinitionsInHeadersCheck.cpp
|
2015-06-16 22:27:31 +08:00
|
|
|
MacroParenthesesCheck.cpp
|
2015-06-17 22:19:35 +08:00
|
|
|
MacroRepeatedSideEffectsCheck.cpp
|
2014-03-05 21:14:32 +08:00
|
|
|
MiscTidyModule.cpp
|
2016-02-09 22:08:49 +08:00
|
|
|
MisplacedWideningCastCheck.cpp
|
2015-09-29 21:12:21 +08:00
|
|
|
NewDeleteOverloadsCheck.cpp
|
2015-09-30 22:09:38 +08:00
|
|
|
NonCopyableObjects.cpp
|
2016-04-27 01:30:30 +08:00
|
|
|
RedundantExpressionCheck.cpp
|
2015-09-11 00:37:46 +08:00
|
|
|
SizeofContainerCheck.cpp
|
[clang-tidy] Add new checker for suspicious sizeof expressions
Summary:
This check is finding suspicious cases of sizeof expression.
Sizeof expression is returning the size (in bytes) of a type or an
expression. Programmers often abuse or misuse this expression.
This checker is adding common set of patterns to detect some
of these bad constructs.
Some examples found by this checker:
R/packages/ifultools/ifultools/src/fra_neig.c
```
/* free buffer memory */
(void) mutil_free( dist_buff, sizeof( ctr * sizeof( double ) ) );
(void) mutil_free( nidx_buff, sizeof( ctr * sizeof( sint32 ) ) );
```
graphviz/v2_20_2/lib/common/utils.c
```
static Dtdisc_t mapDisc = {
offsetof(item, p),
sizeof(2 * sizeof(void *)),
offsetof(item, link),
(Dtmake_f) newItem,
(Dtfree_f) freeItem,
(Dtcompar_f) cmpItem,
NIL(Dthash_f),
NIL(Dtmemory_f),
NIL(Dtevent_f)
};
```
mDNSResponder/mDNSShared/dnsextd.c
```
context = ( TCPContext* ) malloc( sizeof( TCPContext ) );
require_action( context, exit, err = mStatus_NoMemoryErr; LogErr( "AcceptTCPConnection", "malloc" ) );
mDNSPlatformMemZero( context, sizeof( sizeof( TCPContext ) ) );
context->d = self;
```
Reviewers: alexfh
Subscribers: malcolm.parsons, Eugene.Zelenko, cfe-commits
Differential Revision: http://reviews.llvm.org/D19014
llvm-svn: 266451
2016-04-16 00:36:00 +08:00
|
|
|
SizeofExpressionCheck.cpp
|
2015-03-02 18:46:43 +08:00
|
|
|
StaticAssertCheck.cpp
|
2015-12-15 16:47:20 +08:00
|
|
|
StringIntegerAssignmentCheck.cpp
|
2016-04-08 00:16:36 +08:00
|
|
|
StringLiteralWithEmbeddedNulCheck.cpp
|
2016-12-27 18:07:39 +08:00
|
|
|
SuspiciousEnumUsageCheck.cpp
|
2016-04-01 02:12:23 +08:00
|
|
|
SuspiciousMissingCommaCheck.cpp
|
2016-02-11 17:23:33 +08:00
|
|
|
SuspiciousSemicolonCheck.cpp
|
2016-04-22 01:19:36 +08:00
|
|
|
SuspiciousStringCompareCheck.cpp
|
2014-07-14 22:24:30 +08:00
|
|
|
SwappedArgumentsCheck.cpp
|
2015-10-10 04:42:44 +08:00
|
|
|
ThrowByValueCatchByReferenceCheck.cpp
|
2014-07-31 17:58:52 +08:00
|
|
|
UndelegatedConstructor.cpp
|
2016-04-19 21:48:39 +08:00
|
|
|
UniqueptrResetReleaseCheck.cpp
|
2015-08-01 00:08:10 +08:00
|
|
|
UnusedAliasDeclsCheck.cpp
|
2015-07-20 09:06:44 +08:00
|
|
|
UnusedParametersCheck.cpp
|
2015-03-09 19:48:54 +08:00
|
|
|
UnusedRAIICheck.cpp
|
2016-04-19 21:48:39 +08:00
|
|
|
UnusedUsingDeclsCheck.cpp
|
2014-03-05 21:14:32 +08:00
|
|
|
|
|
|
|
LINK_LIBS
|
2016-09-14 21:33:11 +08:00
|
|
|
clangAnalysis
|
2014-03-05 21:14:32 +08:00
|
|
|
clangAST
|
|
|
|
clangASTMatchers
|
|
|
|
clangBasic
|
2014-07-14 13:01:53 +08:00
|
|
|
clangLex
|
2014-03-05 21:14:32 +08:00
|
|
|
clangTidy
|
2015-10-07 00:32:50 +08:00
|
|
|
clangTidyUtils
|
2016-05-12 05:32:29 +08:00
|
|
|
clangTooling
|
2014-03-05 21:14:32 +08:00
|
|
|
)
|