xref: /llvm-project/clang-tools-extra/docs/clang-tidy/checks/misc/misleading-identifier.rst (revision 6e566bc5523f743bc34a7e26f050f1f2b4d699a8)
1.. title:: clang-tidy - misc-misleading-identifier
2
3misc-misleading-identifier
4==========================
5
6Finds identifiers that contain Unicode characters with right-to-left direction,
7which can be confusing as they may change the understanding of a whole statement
8line, as described in `Trojan Source <https://trojansource.codes>`_.
9
10An example of such misleading code follows:
11
12.. code-block:: text
13
14  #include <stdio.h>
15
16  short int א = (short int)0;
17  short int ג = (short int)12345;
18
19  int main() {
20    int א = ג; // a local variable, set to zero?
21    printf("ג is %d\n", ג);
22    printf("א is %d\n", א);
23  }
24