[PATCH] D83717: [clang-tidy] Add check fo SEI CERT item ENV32-C

Eugene Zelenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 14 06:47:29 PDT 2020


Eugene.Zelenko added inline comments.


================
Comment at: clang-tools-extra/docs/ReleaseNotes.rst:87
+  <clang-tidy/checks/cert-env32-c>` check.
+  Finds functions registered by ``atexit`` and ``at_quick_exit`` that are calling
+  exit functions ``_Exit``, ``exit``, ``quick_exit`` or ``longjmp``.
----------------
Please separate with empty line.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/cert-env32-c.rst:6
+
+This check implements SEI CERT rule ENV32-C.
+Description source: `<https://wiki.sei.cmu.edu/confluence/display/c/ENV32-C.+All+exit+handlers+must+return+normally>`_
----------------
Please synchronize with statement in Release Notes.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/cert-env32-c.rst:7
+This check implements SEI CERT rule ENV32-C.
+Description source: `<https://wiki.sei.cmu.edu/confluence/display/c/ENV32-C.+All+exit+handlers+must+return+normally>`_
+
----------------
Reference to original description usually placed at the end. 


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/cert-env32-c.rst:12
+
+The C Standard provides three functions that cause an application to terminate normally: _Exit(), exit(), and quick_exit(). These are collectively called exit functions. When the exit() function is called, or control transfers out of the main() entry point function, functions registered with atexit() are called (but not at_quick_exit()). When the quick_exit() function is called, functions registered with at_quick_exit() (but not atexit()) are called. These functions are collectively called exit handlers.  When the _Exit() function is called, no exit handlers or signal handlers are called.
+
----------------
Please enclose all function names in double back-ticks. Same below.

Please don't use lines longer then 80 symbols.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/cert-env32-c.rst:16
+
+A nested call to an exit function is undefined behavior. (See undefined behavior 182.) This behavior can occur only when an exit function is invoked from an exit handler or when an exit function is called from within a signal handler. (See SIG30-C. Call only asynchronous-safe functions within signal handlers.)
+
----------------
Is //SIG30-C// implemented in Clang-tidy? If not, reference should be removed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83717





More information about the cfe-commits mailing list