llvm-project/clang-tools-extra/clang-tidy/cert
Gabor Bencze 3373e84539 [clang-tidy] Add bugprone-suspicious-memory-comparison check
The check warns on suspicious calls to `memcmp`.
It currently checks for comparing types that do not have
unique object representations or are non-standard-layout.
Based on
  https://wiki.sei.cmu.edu/confluence/display/c/EXP42-C.+Do+not+compare+padding+data
  https://wiki.sei.cmu.edu/confluence/display/c/FLP37-C.+Do+not+use+object+representations+to+compare+floating-point+values
and part of
  https://wiki.sei.cmu.edu/confluence/display/cplusplus/OOP57-CPP.+Prefer+special+member+functions+and+overloaded+operators+to+C+Standard+Library+functions
Add alias `cert-exp42-c` and `cert-flp37-c`.

Some tests are currently failing at head, the check depends on D89649.
Originally started in D71973

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D89651
2021-08-26 09:23:37 +02:00
..
CERTTidyModule.cpp [clang-tidy] Add bugprone-suspicious-memory-comparison check 2021-08-26 09:23:37 +02:00
CMakeLists.txt [clang-tidy] Add new check 'concurrency-thread-canceltype-asynchronous' and alias 'cert-pos47-c'. 2021-02-22 12:42:20 +01:00
CommandProcessorCheck.cpp [NFC] Use hasAnyName matcher in place of anyOf(hasName()...) 2020-07-07 14:31:04 +01:00
CommandProcessorCheck.h
DefaultOperatorNewAlignmentCheck.cpp Prune TargetInfo.h include from ParsedAttr.h, NFC 2020-03-11 20:47:11 -07:00
DefaultOperatorNewAlignmentCheck.h [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
DontModifyStdNamespaceCheck.cpp [NFC] Use hasAnyName matcher in place of anyOf(hasName()...) 2020-07-07 14:31:04 +01:00
DontModifyStdNamespaceCheck.h [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
FloatLoopCounter.cpp
FloatLoopCounter.h
LICENSE.TXT
LimitedRandomnessCheck.cpp [clang-tidy] Applied clang-tidy fixes. NFC 2021-01-29 01:01:19 +01:00
LimitedRandomnessCheck.h
MutatingCopyCheck.cpp [clang-tidy] Use new mapping matchers 2021-02-03 23:21:17 +00:00
MutatingCopyCheck.h [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
NonTrivialTypesLibcMemoryCallsCheck.cpp [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
NonTrivialTypesLibcMemoryCallsCheck.h [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
PostfixOperatorCheck.cpp [NFC] use hasAnyOperatorName and hasAnyOverloadedOperatorName functions in clang-tidy matchers 2020-03-10 00:42:21 +00:00
PostfixOperatorCheck.h [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
ProperlySeededRandomGeneratorCheck.cpp Remove references to the ast_type_traits namespace 2020-12-11 00:58:46 +01:00
ProperlySeededRandomGeneratorCheck.h
SetLongJmpCheck.cpp [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
SetLongJmpCheck.h [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
StaticObjectExceptionCheck.cpp Remove references to the ast_type_traits namespace 2020-12-11 00:58:46 +01:00
StaticObjectExceptionCheck.h [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
StrToNumCheck.cpp [clang-tidy] Applied clang-tidy fixes. NFC 2021-01-29 01:01:19 +01:00
StrToNumCheck.h
ThrownExceptionTypeCheck.cpp Remove references to the ast_type_traits namespace 2020-12-11 00:58:46 +01:00
ThrownExceptionTypeCheck.h [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
VariadicFunctionDefCheck.cpp [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00
VariadicFunctionDefCheck.h [clang-tidy] Change checks to use new isLanguageVersionSupported restriction 2020-03-03 16:43:45 +00:00