[PATCH] D64736: [clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite loops

Balogh, Ádám via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 15 06:17:32 PDT 2019


baloghadamsoftware created this revision.
baloghadamsoftware added reviewers: aaron.ballman, lebedev.ri, alexfh.
baloghadamsoftware added a project: clang-tools-extra.
Herald added subscribers: gamesh411, whisperity, mgorny.
Herald added a project: clang.

Although detecting infinite loops in general is impossible (Halting-problem) there are some obvious cases where it is possible. Detecting such loops is beneficial since the tests will hang on programs containing infinite loops so testing-time detection may be costly in large systems. Obvious cases are where the programmer forgets to increment/decrement the counter or increments/decrements the wrong variable.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D64736

Files:
  clang-tidy/bugprone/BugproneTidyModule.cpp
  clang-tidy/bugprone/CMakeLists.txt
  clang-tidy/bugprone/InfiniteLoopCheck.cpp
  clang-tidy/bugprone/InfiniteLoopCheck.h
  docs/ReleaseNotes.rst
  docs/clang-tidy/checks/bugprone-infinite-loop.rst
  docs/clang-tidy/checks/list.rst
  test/clang-tidy/bugprone-infinite-loop.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64736.209837.patch
Type: text/x-patch
Size: 17456 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190715/866848fd/attachment-0001.bin>


More information about the cfe-commits mailing list