<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64828>64828</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Winteger-overflow does not detect overflow on unsigned integers,
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:diagnostics
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
PiotrZSL
</td>
</tr>
</table>
<pre>
Example:
```
std::size_t k1Pb = 1024U * 1024U * 1024U * 1024U * 1024U;
//k1Pb:
// .quad 0 # 0x0
```
overflow to 0, not detected by both GCC and Clang, when:
```
std::size_t k1Pb = 1LU * 1024U * 1024U * 1024U * 1024U * 1024U;
//k1Pb:
// .quad 1125899906842624 # 0x4000000000000
```
is calculated correctly, at same time code like this:
```
std::size_t k1Pb = 1024 * 1024 * 1024 * 1024 * 1024;
```
Trigger -Winteger-overflow in Clang and -Woverflow in GCC.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycU81unDAQfhpzGe3KHrwEHzhsSDeXHCK1VaReKmNPwI3BqW3y06evIKskVaMoygiBsfFnvp_RKbl-ImrY7pTtzgo95yHE5tKFHH98vSi6YB-bLw96vPXEyj3jZ4zvWcWP1_qasl2Wyn1yf-hnhhtx2QErzwAER_kdGO4_MmLl6REeDwwPC8rLiesUHGv7e9YWOLxfDEvgD_zNX366hzuK1z7cQw7AGbYwhQyWMplMFrpH6EIe4LxtQU8WWq-nfvnqfqDpE1pcfFiJz2siBO5qpRSvaokVyrc1kfxVvUnDJTDam9nrRQkTYiST_ePCXmdIeiTIbiQwwRJ4d0OQB5c-F5Bntu8MXnT4F_lbdH1PETZXbsrUU9w8e-qmJ8dW7zZXr-fP23Zb2Ka0qlS6oEZUCuUJV0oUQ1MSFxVWOyOvUaASsqMOlar4TlbaipPCNcix5LVQopZqJ7Ynsu5sXfG6RmmsFkxyGrXzW-_vxm2IfeFSmqmpZI114XVHPq39hmjWTJV763Q_hZSdSQxxacTYLLs33dwnJrl3KacXvOyyp-Z_zjZQehVieF4IE8zT2ukWjrsSw7aYo2-GnG9X69Y89S4Pc7c1YWR4WA48Pja3MfwikxkeVjaJ4WEl9DcAAP__YNMpZg">