<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/73433>73433</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang-tidy] Variable is non-const and globally accessible, consider making it const 
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-tidy
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          MaJerle
      </td>
    </tr>
</table>

<pre>
    I have a module based static variable, that clang reports as *globally accessible*

```c
//...
static osMutexId_t app_sys_mutex;
//
```

https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-non-const-global-variables.html

```
[{
        "message": "variable 'app_sys_mutex' is non-const and globally accessible, consider making it const",
        "source": "C/C++",
}]
```

It is a module specific variable, that must be module global.
Why does it report it as *globally accessible*, if it is *static*?

Version: 17.0.5
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykU0FvozwQ_TXmYoHMAKUcODSJkPpJvfY7VgZPwFuDkcdEzb9fmYQuXVW9rGQlHvvZ7z3zRhLpfkKsWXFgxSmSix-sq1_kf-gMRq1V1_qZD_KCXPLRqsUgbyWh4uSl1x2_SKdla5DBkftBet4ZOfXc4WydJy6JM3jqjW2lMVcuuw6J9Ip_YuLExPb7IG6ju9fQMGiSJLmVdzJLL4vHj2f15rmc5ze60tsYVlh22J_768490eD9TCy7A1exiTGXMbGuZ9Dgh3dy24i9VtdQDNi9U5jMc2cd9otWaPSEYU1erFbxZKe4sxP5-OY13t6FksGP5lur97I4sHJTLyoGMCKR7JEBsOyJM4DtLs6g_GobSq6Jf5JzOSn-7WMfeQBohY6P8l1PPdd-XfKBBo57frKL63b0RwbNkcFhHTtweWLF6YenfvZB3GdsaMZOn7-LzLiQ5y1uwJuB-5f_f7hyZZGC3luowuzHWMGR63NA6RV1y07YyJq9vFd0pO0UTKZlIpIiUnWmqqySEdZpKURVpfmjiIb6Mc1lmqM6Z0UhziW2qgIoC-hECkrJc6RrEJClKTyIKnsUImnLM1ZKirxEUaSlYrnAUWrzGbVIEy1Yl1meZZGRLRpaWxBgnzwILenqcChul55YLowmT3-u8dqbtXl3x4oTf90S86_p4NHiTP21aXrth6VNOjsyaIKS-188O_sLO8-gWd2F7lgN_g4AAP__UVZdHA">