[PATCH] D90944: [clang-tidy] implement misc-mt-unsafe

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 6 11:53:10 PST 2020


njames93 added a comment.

It appears to not check for signs that the code is running in a multi threaded manner, This will result in many false positives in code that is known to be single threaded.



================
Comment at: clang-tools-extra/clang-tidy/misc/MtUnsafeCheck.cpp:19
+
+namespace {
+
----------------
Don't use an anonymous namespace, just make the decls contained static.


================
Comment at: clang-tools-extra/clang-tidy/misc/MtUnsafeCheck.cpp:199
+  diag(Call->getBeginLoc(), "function is not thread safe")
+      << SourceRange(Call->getBeginLoc(), Call->getEndLoc());
+}
----------------
I don't think this range needs appending onto the diagnostic.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/list.rst:33
    `abseil-upgrade-duration-conversions <abseil-upgrade-duration-conversions.html>`_, "Yes"
-   `altera-struct-pack-align <altera-struct-pack-align.html>`_,
+   `altera-struct-pack-align <altera-struct-pack-align.html>`_, "Yes"
    `android-cloexec-accept <android-cloexec-accept.html>`_, "Yes"
----------------
Can you undo this change and all other unrelated changes to this file.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90944/new/

https://reviews.llvm.org/D90944



More information about the cfe-commits mailing list