brintos

brintos / llvm-project-archived public Read only

0
0
Text · 559 B · 26a5af7 Raw
28 lines · plain
1.. title:: clang-tidy - readability-misplaced-array-index2 3readability-misplaced-array-index4=================================5 6This check warns for unusual array index syntax.7 8The following code has unusual array index syntax:9 10.. code-block:: c++11 12  void f(int *X, int Y) {13    Y[X] = 0;14  }15 16becomes17 18.. code-block:: c++19 20  void f(int *X, int Y) {21    X[Y] = 0;22  }23 24The check warns about such unusual syntax for readability reasons:25 * There are programmers that are not familiar with this unusual syntax.26 * It is possible that variables are mixed up.27 28