Eugene.Zelenko added inline comments.
Comment at: clang-tools-extra/docs/clang-tidy/checks/cert-oop57-cpp.rst:25
+ Default is an empty string.
+ The check will detect the following functions:
+ `std::memcpy`, `memcpy`, `std::memmove`, `memmove`, `std::strcpy`,
merge_guards_bot added a comment.
{icon check-circle color=green} Unit tests: pass. 62027 tests passed, 0 failed
and 783 were skipped.
{icon question-circle color=gray} clang-tidy: unknown.
{icon times-circle color=red} clang-format: fail. Please format your changes
with clang-format by
njames93 updated this revision to Diff 239153.
njames93 added a comment.
- rebase truck
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72488/new/
https://reviews.llvm.org/D72488
Files:
clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa42c3eb599cb: [clang-tidy] Add check for CERT-OOP57-CPP
(authored by njames93).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72488/new/
aaron.ballman added a comment.
Btw, do you need me to commit this on your behalf, or have you obtained your
commit privileges?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72488/new/
https://reviews.llvm.org/D72488
merge_guards_bot added a comment.
{icon check-circle color=green} Unit tests: pass. 61956 tests passed, 0 failed
and 783 were skipped.
{icon question-circle color=gray} clang-tidy: unknown.
{icon times-circle color=red} clang-format: fail. Please format your changes
with clang-format by
njames93 updated this revision to Diff 238775.
njames93 marked an inline comment as done.
njames93 added a comment.
- Fix If stmt and optimise building function name list
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72488/new/
merge_guards_bot added a comment.
{icon check-circle color=green} Unit tests: pass. 61941 tests passed, 0 failed
and 783 were skipped.
{icon question-circle color=gray} clang-tidy: unknown.
{icon times-circle color=red} clang-format: fail. Please format your changes
with clang-format by
njames93 updated this revision to Diff 238753.
njames93 added a comment.
- added few more functions, fix format error
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72488/new/
https://reviews.llvm.org/D72488
Files:
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM with a few nits.
Comment at:
clang-tools-extra/clang-tidy/cert/NonTrivialTypesLibcMemoryCallsCheck.cpp:71-74
+ if (!getLangOpts().CPlusPlus)
+
merge_guards_bot added a comment.
{icon check-circle color=green} Unit tests: pass. 61850 tests passed, 0 failed
and 781 were skipped.
{icon question-circle color=gray} clang-tidy: unknown.
{icon times-circle color=red} clang-format: fail. Please format your changes
with clang-format by
njames93 marked 3 inline comments as done.
njames93 added inline comments.
Comment at: clang-tools-extra/docs/clang-tidy/checks/cert-oop57-cpp.rst:6
+
+ Flags use of the `C` standard library functions 'memset', 'memcpy' and
+ 'memcmp' and similar derivatives on non-trivial
njames93 updated this revision to Diff 238153.
njames93 marked an inline comment as done.
njames93 added a comment.
- double ticks
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72488/new/
https://reviews.llvm.org/D72488
Files:
merge_guards_bot added a comment.
{icon check-circle color=green} Unit tests: pass. 61850 tests passed, 0 failed
and 781 were skipped.
{icon question-circle color=gray} clang-tidy: unknown.
{icon times-circle color=red} clang-format: fail. Please format your changes
with clang-format by
merge_guards_bot added a comment.
{icon times-circle color=red} Unit tests: fail. 61849 tests passed, 1 failed
and 781 were skipped.
failed:
libc++.std/thread/thread_mutex/thread_mutex_requirements/thread_mutex_requirements_mutex/thread_mutex_class/try_lock.pass.cpp
{icon question-circle
Eugene.Zelenko added inline comments.
Comment at: clang-tools-extra/docs/ReleaseNotes.rst:112
+
+ Flags use of the `C` standard library functions 'memset', 'memcpy' and
+ 'memcmp' and similar derivatives on non-trivial types.
Please use double back-ticks to
njames93 updated this revision to Diff 238114.
njames93 added a comment.
- remove `This check` from docs... again
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72488/new/
https://reviews.llvm.org/D72488
Files:
merge_guards_bot added a comment.
{icon check-circle color=green} Unit tests: pass. 61850 tests passed, 0 failed
and 781 were skipped.
{icon question-circle color=gray} clang-tidy: unknown.
{icon times-circle color=red} clang-format: fail. Please format your changes
with clang-format by
njames93 added inline comments.
Comment at:
clang-tools-extra/clang-tidy/cert/NotTrivialTypesLibcMemoryCallsCheck.cpp:33-44
+static const char BuiltinMemSet[] = "::std::memset;"
+"::memset;";
+static const char BuiltinMemCpy[] =
njames93 updated this revision to Diff 238052.
njames93 marked 13 inline comments as done.
njames93 added a comment.
- Fix a few nits, extra names will follow
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72488/new/
https://reviews.llvm.org/D72488
aaron.ballman added inline comments.
Comment at:
clang-tools-extra/clang-tidy/cert/NotTrivialTypesLibcMemoryCallsCheck.cpp:33-44
+static const char BuiltinMemSet[] = "::std::memset;"
+"::memset;";
+static const char BuiltinMemCpy[] =
njames93 updated this revision to Diff 237492.
njames93 marked an inline comment as done.
njames93 added a comment.
Figured out what memset you meant...
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72488/new/
https://reviews.llvm.org/D72488
Eugene.Zelenko added inline comments.
Comment at: clang-tools-extra/docs/clang-tidy/checks/cert-oop57-cpp.rst:14
+
+ Specify extra functions to flag that act similarily to memset.
+ Default is an empty string.
Somehow memset is still not in double
njames93 updated this revision to Diff 237422.
njames93 added a comment.
- Reworked options documentation
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72488/new/
https://reviews.llvm.org/D72488
Files:
Eugene.Zelenko added inline comments.
Comment at: clang-tools-extra/docs/clang-tidy/checks/cert-oop57-cpp.rst:16
+ Default is an empty string.
+ The check will detect the following memory setting function:
+ ``memset``
This repeats first sentence in
njames93 updated this revision to Diff 237393.
njames93 marked 3 inline comments as done.
njames93 added a comment.
- Fixed more documentation nits
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72488/new/
https://reviews.llvm.org/D72488
Files:
Eugene.Zelenko added inline comments.
Comment at: clang-tools-extra/docs/clang-tidy/checks/cert-oop57-cpp.rst:14
+
+ Specify extra functions to flag on that act similarily to memset.
+ Default is an empty string
Please enclose memset in double back-ticks.
njames93 updated this revision to Diff 237390.
njames93 marked 3 inline comments as done.
njames93 added a comment.
- Fix format of options docs and remove unnecessary empty line
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72488/new/
Eugene.Zelenko added inline comments.
Comment at:
clang-tools-extra/clang-tidy/cert/NotTrivialTypesLibcMemoryCallsCheck.cpp:75
+MatchFinder *Finder) {
+
+ if (!getLangOpts().CPlusPlus)
Unnecessary empty line.
Comment at:
njames93 updated this revision to Diff 237367.
njames93 added a comment.
Tweaked a few documentation issues
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72488/new/
https://reviews.llvm.org/D72488
Files:
Eugene.Zelenko added a comment.
Please describe options in documentation. See other checks documentation as
example.
Comment at: clang-tools-extra/docs/ReleaseNotes.rst:112
+
+ This check flags use of the c standard library functions ``memset``,
``memcpy``,
+
njames93 added inline comments.
Comment at: clang-tools-extra/docs/ReleaseNotes.rst:70
+- The 'bugprone-suspicous-constructor-and-assignment' check was renamed to
:doc:`cert-not-trivial-types-libc-memory-calls
+ `
Eugene.Zelenko wrote:
> Is this relevant?
njames93 updated this revision to Diff 237315.
njames93 marked 4 inline comments as done.
njames93 added a comment.
Added a way to specify custom mem set copy and compare functions plus nit fixes
Can now use the options MemSetNames, MemCpyNames and MemCmpNames to specify
custom functions to
Eugene.Zelenko added a comment.
It may be reasonable to provide options to expand list of problematic
functions. See bugprone-suspicious-string-compare as example.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72488/new/
Eugene.Zelenko added inline comments.
Comment at:
clang-tools-extra/clang-tidy/cert/NotTrivialTypesLibcMemoryCallsCheck.cpp:51
+MatchFinder *Finder) {
+ using namespace ast_matchers::internal;
+ auto IsStructPointer = [](Matcher Constraint = anything(),
njames93 created this revision.
njames93 added projects: clang, clang-tools-extra.
Herald added subscribers: cfe-commits, xazax.hun, mgorny.
This is a very basic warning implementation of Prefer special member functions
and overloaded operators to C Standard Library functions
36 matches
Mail list logo