<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/72917>72917</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-tidy: use of signed integer operand with binary bitwise
</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>
```c
void
my_func(uint16_t hex, char* ascii) {
for (uint8_t idx = 4U; idx != 0; --idx) {
uint8_t aux = (hex >> (4U * (idx - 1U))) & 0x0FU;
aux = (aux <= 9U) ? (aux + 0x30U) : (aux + 0x57U);
ascii[4U - idx] = (char)aux;
}
ascii[4] = '\0';
}
```
returns *use of a signed integer operand with a biary bitwise operator* and points to line `uint8_t aux = (hex >> (4U * (idx - 1U))) & 0x0FU;`
This is part of `hicpp-signed-bitwise`
Version `17.0.5`
Why?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyskz2PozwQxz_N0IyIzBhCKCiSzVI80tNd7sqVwSb4RDCyzW7y7U-GbN6Kqy6yZM84v3n7Y-GcPg5KlZDtINtHYvKdseX_4j9lexXVRl5KWLNlNcD2wLafRsvldLp8tNPQAG0mPfhk_eGxU2egN2w6YYG2KFyjNVCBkO8WBhGxNRav0ObDo5ZnBL7H9AB8t1iUBAcLdhxreX4O8Q2KaQGBNp0Kx3fg78FKDxiyA21CtBiTA1CxLARaIzuzKiRb4t0LC7-HoMvxLVjFYWZ5dfPTDtmZs6t_--zP8jkj373EnseR7dIDxqFRyPbfuZaJFWI6P1GQ7-_GDb9zOWRvLGy3Zr6Bm2yPTVrlJzu4MJ3JKTQtCpy_AIl68OqoLJpRWTFI_NK-Q4G1FvaCtfZfOgDh0ptF20HiaPTgHXqDvR4Uwpr9O22eK__RaYfa4SisD3XDmnW6Gcd4KT--VvhC_VTWaTOEfyf5iq2yl_tf3QV4FcmSy4IXIlJlkjOWJVmSpVFXkqybgiTjrcibtGh5LXlRU71JZc6pbSNdEiOeJMQoSYokXXGZpbxtWbZhgoSsIWXqJHS_6vvP08rYY6Sdm1SZU5HkUS9q1bv58RE1vRiOsdfyAkThMdoyQHE9HR2krNfOu3sYr32vygeGb_Eq6d8ErfXwoGc02b7svB8d8C1QBVQdte-metWYE1AVsl23eLTmt2o8UDV34ICquYk_AQAA___N8zPC">