llvm-project/clang-tools-extra/clang-tidy
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
..
abseil abseil-string-find-str-contains should not propose an edit for the three-parameter version of find(). 2021-08-10 16:39:17 +00:00
altera [clang-tools-extra] Rename StringRef _lower() method calls to _insensitive() 2021-06-25 00:22:01 +03:00
android [clang-tidy] Applied clang-tidy fixes. NFC 2021-01-29 01:01:19 +01:00
boost [openmp] Add missing dependencies for OMP.h.inc after d90443b 2020-06-23 11:48:04 -04:00
bugprone [clang-tidy] Add bugprone-suspicious-memory-comparison check 2021-08-26 09:23:37 +02:00
cert [clang-tidy] Add bugprone-suspicious-memory-comparison check 2021-08-26 09:23:37 +02:00
concurrency [clang-tidy] Add new check 'concurrency-thread-canceltype-asynchronous' and alias 'cert-pos47-c'. 2021-02-22 12:42:20 +01:00
cppcoreguidelines [clang-tidy] fix duplicate '{}' in cppcoreguidelines-pro-type-member-init 2021-08-14 10:48:04 +08:00
darwin [openmp] Add missing dependencies for OMP.h.inc after d90443b 2020-06-23 11:48:04 -04:00
fuchsia [clang-tidy] Applied clang-tidy fixes. NFC 2021-01-29 01:01:19 +01:00
google [Branch-Rename] Fix some links 2021-02-01 16:43:21 +05:30
hicpp [clang-tidy] Applied clang-tidy fixes. NFC 2021-01-29 01:01:19 +01:00
linuxkernel [openmp] Add missing dependencies for OMP.h.inc after d90443b 2020-06-23 11:48:04 -04:00
llvm [clang-tidy][NFC] Update tests and Default options to use boolean value 2021-05-04 18:17:56 +01:00
llvmlibc [clang-tidy][NFC] Remove unnecessary includes throughout clang-tidy header files 2020-06-29 16:05:52 +01:00
misc [clang-tidy] Don't suggest "inline" fix for main function in 2021-07-20 14:24:38 +02:00
modernize [llvm][clang][NFC] updates inline licence info 2021-08-11 02:48:53 +00:00
mpi [clang-tidy] Fix mpi checks when running multiple TUs per clang-tidy process 2021-03-25 14:38:37 +00:00
objc [llvm][clang][NFC] updates inline licence info 2021-08-11 02:48:53 +00:00
openmp [clang-tidy][NFC] Remove unnecessary includes throughout clang-tidy header files 2020-06-29 16:05:52 +01:00
performance [clang-tidy] performance-unnecessary-copy-initialization: Create option to exclude container types from triggering the check. 2021-07-22 16:20:20 -04:00
plugin [clang-tidy] Applied clang-tidy fixes. NFC 2021-01-29 01:01:19 +01:00
portability [clang-tidy][NFC] Tweak some generation of diag messages 2021-02-26 19:10:25 +00:00
readability [clang-tidy] [PR50069] readability-braces-around-statements doesn't work well with [[likely]] [[unlikely]] 2021-08-14 12:05:21 +01:00
tool [clang-tidy] ensure run-clang-tidy reports children killed by signals 2021-07-19 14:18:26 +02:00
utils [clang-tidy] bugprone-infinite-loop: forFunction() -> forCallable(). 2021-05-13 11:25:01 -07:00
zircon Remove references to the ast_type_traits namespace 2020-12-11 00:58:46 +01:00
CMakeLists.txt [clang-tidy] add concurrency module 2020-11-30 12:27:17 +03:00
ClangTidy.cpp [libtooling][clang-tidy] Fix diagnostics not highlighting fed SourceRanges 2021-04-10 16:43:44 +02:00
ClangTidy.h [clang-tidy] Added command line option `fix-notes` 2021-03-01 22:07:11 +00:00
ClangTidyCheck.cpp [clang-tidy] Add new case type to check variables with Hungarian notation 2021-08-01 15:22:17 -07:00
ClangTidyCheck.h [clang-tidy] Add new case type to check variables with Hungarian notation 2021-08-01 15:22:17 -07:00
ClangTidyDiagnosticConsumer.cpp Remark was added to clang tooling Diagnostic 2021-05-24 11:21:44 -04:00
ClangTidyDiagnosticConsumer.h [clang-tidy] Added command line option `fix-notes` 2021-03-01 22:07:11 +00:00
ClangTidyForceLinker.h [clang-tidy] add concurrency module 2020-11-30 12:27:17 +03:00
ClangTidyModule.cpp [clang-tidy][NFC] Use StringMap for ClangTidyCheckFactories::FacoryMap 2020-07-30 22:57:33 +01:00
ClangTidyModule.h [clang-tidy][NFC] Remove unnecessary headers 2020-12-28 15:01:51 +00:00
ClangTidyModuleRegistry.h
ClangTidyOptions.cpp [clang-tidy] Applied clang-tidy fixes. NFC 2021-01-29 01:01:19 +01:00
ClangTidyOptions.h [clang-tidy] Add a diagnostic callback to parseConfiguration 2020-12-17 00:24:58 +00:00
ClangTidyProfiling.cpp [clang-tidy][NFC] Remove unnecessary headers 2020-12-28 15:01:51 +00:00
ClangTidyProfiling.h [clang-tidy][NFC] Remove unnecessary includes throughout clang-tidy header files 2020-06-29 16:05:52 +01:00
ExpandModularHeadersPPCallbacks.cpp [NFC] Unify FIME with FIXME in comments 2021-03-10 14:00:51 +01:00
ExpandModularHeadersPPCallbacks.h Avoid including FileManager.h from SourceManager.h 2020-03-11 13:53:12 -07:00
GlobList.cpp [clang-tidy] Ignore all spaces in the list of checks 2021-03-24 06:43:13 -07:00
GlobList.h [clang-tidy][NFC] Made Globlist::contains const 2020-12-08 22:26:55 +00:00
add_new_check.py [clang-tidy] Always open files using UTF-8 encoding 2021-08-02 11:36:04 +02:00
clang-tidy-config.h.cmake Add an explicit toggle for the static analyzer in clang-tidy 2020-09-10 10:48:17 -04:00
rename_check.py [clang-tidy] Always open files using UTF-8 encoding 2021-08-02 11:36:04 +02:00