[PATCH] D63623: [clang-tidy] Add a check on expected return values of posix functions (except posix_openpt) in Android module.

Eugene Zelenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 20 16:14:30 PDT 2019


Eugene.Zelenko added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/android/PosixReturnCheck.h:1
+//===--- PosixReturnCheck.h - clang-tidy--------*- C++ -*-====================//
+//
----------------
Please use - before *- C++ -* to fill line. See other checks as example.


================
Comment at: clang-tools-extra/docs/ReleaseNotes.rst:199
 
+- New :doc:`android-posix-return
+  <clang-tidy/checks/android-posix-return>` check.
----------------
Please move into new checks list (in alphabetical order).


================
Comment at: clang-tools-extra/docs/ReleaseNotes.rst:202
+
+  Checks if any alls to posix functions (except posix_openpt) expect negative
+  return values
----------------
calls? posix -> POSIX. Please enclose posix_openpt in double back-ticks.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/android-posix-return.rst:4
+android-posix-return
+=====================
+
----------------
Please make same length as name.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/android-posix-return.rst:6
+
+Checks if any calls to posix functions (except posix_openpt) expect negative
+return values. These functions return either 0 on success or an errno on failure,
----------------
Please make same changes as in Release Notes.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/android-posix-return.rst:7
+Checks if any calls to posix functions (except posix_openpt) expect negative
+return values. These functions return either 0 on success or an errno on failure,
+which is positive only.
----------------
Please enclose 0 and errno into double back-ticks.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/android-posix-return.rst:16
+
+This will never happen as the return value is always non-negative. A simple fix could be
+
----------------
Please add colon at end.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63623





More information about the cfe-commits mailing list