[PATCH] D13567: [PATCH] Add checker discouraging use of setjmp/longjmp in C++

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 8 11:13:56 PDT 2015


aaron.ballman created this revision.
aaron.ballman added reviewers: alexfh, sbenza.
aaron.ballman added a subscriber: cfe-commits.

setjmp and longjmp facilities in C++ are unsafe due to the likelihood of triggering undefined behavior with nontrivial type destruction, etc. Instead, exception handling facilities are a better choice. This patch adds a checker that discourages the use of setjmp and longjmp in C++.

This patch corresponds to CERT C++ Coding Standard rule: https://www.securecoding.cert.org/confluence/pages/viewpage.action?pageId=1834

http://reviews.llvm.org/D13567

Files:
  clang-tidy/cert/CERTTidyModule.cpp
  clang-tidy/cert/CMakeLists.txt
  clang-tidy/cert/SetLongJmpCheck.cpp
  clang-tidy/cert/SetLongJmpCheck.h
  docs/clang-tidy/checks/cert-setlongjmp.rst
  docs/clang-tidy/checks/list.rst
  test/clang-tidy/cert-setlongjmp.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13567.36879.patch
Type: text/x-patch
Size: 7739 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151008/56d68f58/attachment-0001.bin>


More information about the cfe-commits mailing list