[PATCH] D21134: clang-tidy: new check readability-misplaced-array-index

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 24 10:30:34 PDT 2016


alexfh requested changes to this revision.
alexfh added a comment.
This revision now requires changes to proceed.

A few nits.


================
Comment at: clang-tidy/readability/MisplacedArrayIndexCheck.h:19
@@ +18,3 @@
+
+/// Warn about unusual array index syntax (index[array] instead of
+/// array[index]).
----------------
Please enclose inline code snippets in backquotes.

================
Comment at: docs/clang-tidy/checks/readability-misplaced-array-index.rst:10
@@ +9,3 @@
+
+.. code:: c++
+
----------------
This should be `.. code-block:: c++`.

================
Comment at: docs/clang-tidy/checks/readability-misplaced-array-index.rst:13
@@ +12,3 @@
+  void f(int *x, int y) {
+    y[x] = 0;
+  }
----------------
danielmarjamaki wrote:
> ok thanks same mistake I've done before. Should I start using uppercase variable names from now on?
Interesting question. Probably, better to do so.


https://reviews.llvm.org/D21134





More information about the cfe-commits mailing list