<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/66054>66054</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`-Wformat` warns about passing long to `printf` with `%I64` format specifier
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
flysand7
</td>
</tr>
</table>
<pre>
When you run the following code:
```
#include <stdint.h>
#include <stdio.h>
int main() {
int64_t counter = 2;
printf("counter = %I64d\n", counter);
return 0;
}
```
The compiler prints the following warning:
```
tests/main.c:18:38: warning: length modifier 'I64' results in undefined behavior or no effect with 'd' conversion specifier [-Wformat]
printf("child thread: counter = %I64d\n", counter);
~^~~~
```
---
My understanding is that I64 shouldn't be tied to `__int64` (aka `long long`) per se but rather to whatever `int64_t` type is defined to be. On windows that *would* be the same as `long long`. However on linux it's defined as `long`, which is kind of an issue, since I want to implement a printf with microsoft extensions
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVE1v4zgM_TXKhUggy1_xwYe0mWB7WOxlgTkWskVH2pGlQKLryaW_fSHHaYNid4ABAgYiRfLx-VEyRnN2iC0rn1h53MiJtA_tYK9ROlVvOq-u7XeNDq5-gjA5II0weGv9bNwZeq-Q5QfGj4zfbcXX3-0ocuN6OykElj9HUsbRTrP82_-F_WN0scYRjNI4JvZMNMDqp5sfwDiqileC3k-OMADLjyBY_hG_BONoWPLE4x0mypeqUKx8dkwIJp7vFZhoHtID0hQc8A8Xq4__PeRi_9YIvR8vxmK4tY5f6JplcMadf80YYaTIxCmNvOtZfsj2LD_kyTwUAIvuTBpGr8xg0lyifqkKJmoIGCdLEYyDySkcjEMFHWr5ZnwAH8B5wGHAnmA2pFOmSnm9d28YovEO4gX7tWz5tP0--DBKYuXxzswXarWxCkgHlCpB-32q31n57f39_Rfkbrfbx-Of12W2EEk6lag1iWtJ8FIVELWfrHJM1AQdAhlUQB5YxV9fF8mwigMTe_lDJqf17gzJpJaigQsGiAjdRBAkaQwpedaS8C0NVfFVdqkKXS-Yet9pJg8d7uAvB7Nxys8rKiYOc8LExGFBpBGiHBFk_ApgB3_4eWnkHVjjpp9giIn6s8VnzoL3GWZtep1A_DBOgR9AOjAxTpiC0bge4QVm6SihM-PF4oiOQK7f8CaC0fTBRz8Q4E9Cl1QQN6rNVZM3coNtVjVFyauyEhvd9nVTNKiyPivzuuOq6jJRcFkXecb7QuYb0wouct5kgu-zime7vBCSK6mG_bBvsnxgBcdRGruz9m3c-XDeLIjbquJlsbGyQxuXR0kIh_N9HJHeqNCmnG03nSMruDWR4mcVMmSxZRX_EG3Fl62JIDs_EVzSk7fSvYpilXK6uKxDYjWJNnluRT73YTMF22qiS0xLLE5MnM6G9NTtej8ycUpA1r_tJfh_sCcmTgv8tNPLeP8GAAD__xVIrO8">