[PATCH] D67865: [clang-tidy] Finds uses of OSRead* calls on macOS that may mask unexpected behavior due to unaligned reads

Eugene Zelenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 20 17:11:10 PDT 2019


Eugene.Zelenko added inline comments.


================
Comment at: clang-tidy/objc/AvoidOSReadCheck.cpp:21
+void AvoidOSReadCheck::registerMatchers(MatchFinder *Finder) {
+  Finder->addMatcher(
+      callExpr(callee((functionDecl(hasAnyName(
----------------
Please add check if language is Objective-C.


================
Comment at: docs/ReleaseNotes.rst:103
+
+  Finds uses of OSRead* calls on macOS that may mask unexpected behavior due to
+  unaligned reads.
----------------
Please enclose OSRead* in double back-ticks.


================
Comment at: docs/clang-tidy/checks/objc-avoid-osread.rst:6
+
+Finds usages of ``OSRead{Big|Little}Int{16|32|64}`` and associated functions which
+should be avoided due to potential unaligned read problems.
----------------
Please synchronize with sentence in Release Notes.


================
Comment at: docs/clang-tidy/checks/objc-avoid-osread.rst:29
+.. code:: c
+   OS_INLINE uint64_t _OSReadInt64(const volatile void *base, uintptr_t byteOffset)
+   {
----------------
Please separate with empty line.


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D67865





More information about the cfe-commits mailing list