[PATCH] D70876: Add spuriously-wake-up-functions check

Kocsis Ábel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 1 10:06:58 PST 2019


abelkocsis created this revision.
abelkocsis added reviewers: aaron.ballman, alexfh, hokein, jfb.
abelkocsis added projects: clang-tools-extra, clang.
Herald added subscribers: cfe-commits, mgehre, dexonsmith, mgorny.

According to 
https://wiki.sei.cmu.edu/confluence/display/cplusplus/CON54-CPP.+Wrap+functions+that+can+spuriously+wake+up+in+a+loop
and
https://wiki.sei.cmu.edu/confluence/display/c/CON36-C.+Wrap+functions+that+can+spuriously+wake+up+in+a+loop
misc-spuriously-wake-up-functions check is created. The check finds 
``cnd_wait`` or `wait` function calls in an ``IfStmt`` and  warns the user to
replace it with a ``WhileStmt`` or use it with a lambda parameter.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D70876

Files:
  clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp
  clang-tools-extra/clang-tidy/misc/CMakeLists.txt
  clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp
  clang-tools-extra/clang-tidy/misc/SpuriouslyWakeUpFunctionsCheck.cpp
  clang-tools-extra/clang-tidy/misc/SpuriouslyWakeUpFunctionsCheck.h
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/cert-con36-c.rst
  clang-tools-extra/docs/clang-tidy/checks/cert-con54-cpp.rst
  clang-tools-extra/docs/clang-tidy/checks/list.rst
  clang-tools-extra/docs/clang-tidy/checks/misc-spuriously-wake-up-functions.rst
  clang-tools-extra/test/clang-tidy/misc-spuriously-wake-up-functions.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70876.231616.patch
Type: text/x-patch
Size: 14971 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191201/b3a2ae14/attachment.bin>


More information about the cfe-commits mailing list