<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62398>62398</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`sizeof(uintptr_t) != sizeof(void *)` in MIPS 64
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
firejox
</td>
</tr>
</table>
<pre>
The size between `uintptr_t` and `void *` are not the same in Clang 16.
Minimal test case
```c
#include <stdint.h>
#include <stddef.h>
void check(void) {
uintptr_t v = (uintptr_t)NULL;
_Static_assert(sizeof(uintptr_t) == sizeof(void *), "It should be same size");
}
```
Godbolt links:
https://godbolt.org/z/8G4dWcv9j
Error message:
```
<source>:5:19: warning: cast to smaller integer type 'uintptr_t' (aka 'unsigned int') from 'void *' [-Wvoid-pointer-to-int-cast]
uintptr_t v = (uintptr_t)NULL;
^~~~~~~~~~~~~~~
<source>:6:5: error: static assertion failed due to requirement 'sizeof(unsigned int) == sizeof(void *)': It should be same size
_Static_assert(sizeof(uintptr_t) == sizeof(void *), "It should be same size");
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<source>:6:38: note: expression evaluates to '4 == 8'
_Static_assert(sizeof(uintptr_t) == sizeof(void *), "It should be same size");
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzElMGO2zgMhp-GvhAJHNqW7YMPmcmkKNAuFuguehzINpNoRpaykpxpe-izL-SkmUzQoEAvNQJHIilS_2dK0nu1NcwNFHdQrBI5hp11zUY5frJfktb2X5t_doxefWNsObwwGwSRjsqEfXCPAUSK0vTRdrCqR6DlZHKMxgYMca0cGJXBey3NFhdijpCuIF0e3x-VUYPUGNgH7KTnk1Okx193mlOmTKfHnhGyex96ZcJ8B9nDDXfPm0v39J422O24ewaq4gSoRijvjl5ExLMsPCBkKwSqXpVS_de_Hz5AdhH_-CnIoLpH6T27AFRFTnZztSymitnOzjMpqoHuEYjeB_Q7O-oe2xOwGAxEMeRHRShXV3Au1b2zfWt1QK3Ms4fsZN2FsJ9mtAZab48xc-u2QOtvQOvqXd5_7g7102WqB-esw4G9l1s-p7qumt17O7qOI-VsWUC2XNSQLfFFOqPMNg476QMGi36QWrNDZQJv2WH4umcEKi8olRG2fJaT2Uxd2cd4oDIi3Dg7RNcruhKhuJt9jobZ3sbMbhbsTJkwi2WhWP3md4Xi4fub56d6xUkzcoQVB37qBTz2grIGN1Jp7rEfOTJw_N-oHA9sQhTy2ilvxP6iWcpY6Eaz_KGujBWheMDvv35ugsyqqMvYwBPRL3vH3keEfJB6lIF9JAhU5j92XUUWf0rxT5Rd98xZ7NtDk_RN1tdZLRNuFqKiQlQLIZJd01Y5C65Y1vWGSWTc5ZQJrnMhu6JaFIlqKKUszalM85RyMW_7smtz0QsSVcadhDzlQSo91_owxBOeKO9HbgRldZVo2bL20zVPZPgFJ2cUVqwS18Q1s3bceshTrXzwr1mCCpobEOkNprS4yVSk8d7_-P7vTyjyZHS6ubqOVNiN7byzA9A6Fjz9zfbOPnEXgNbTNj3QepLxfwAAAP__AQoNZA">