[PATCH] D34913: [clang-tidy] Add a new Android check "android-cloexec-socket"
Eugene Zelenko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 30 18:18:29 PDT 2017
Eugene.Zelenko requested changes to this revision.
Eugene.Zelenko added a comment.
This revision now requires changes to proceed.
Please wait for Alexander, Aaron or Haojian approval.
================
Comment at: clang-tidy/android/CloexecOpenCheck.cpp:22
namespace {
static constexpr const char *O_CLOEXEC = "O_CLOEXEC";
----------------
Anonymous namespaces should contain only class declarations. static is enough.
================
Comment at: clang-tidy/android/CloexecSocketCheck.cpp:21
+
+namespace {
+static constexpr const char *SOCK_CLOEXEC = "SOCK_CLOEXEC";
----------------
Anonymous namespaces should contain only class declarations. static is enough.
================
Comment at: docs/ReleaseNotes.rst:79
+
+ Checks if the required file flag ``SOCK_CLOEXEC`` exists in ``socket()``.
+
----------------
Maybe present in arguments of instead of exist will sound better?
================
Comment at: docs/clang-tidy/checks/android-cloexec-socket.rst:5
+======================
+``socket()`` should include ``SOCK_CLOEXEC`` in its type argument to avoid the
+file descriptor leakage.
----------------
Please add empty line there.
Repository:
rL LLVM
https://reviews.llvm.org/D34913
More information about the cfe-commits
mailing list