<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/76377>76377</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang should not warn about exact-width specifiers for printf
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
sstwcw
</td>
</tr>
</table>
<pre>
Compiling this code gives a warning. I expect no warning. GCC does not give a warning since version 13. It looks like the front end does not recognize that specifiers for exact-width types are allowed.
```C
#include <stdint.h>
#include <stdio.h>
int main(void) {
printf("%w64d\n", INT64_C(0));
return 0;
}
```
```
clang -Wall -std=c2x print.c
print.c:5:13: warning: invalid conversion specifier '6' [-Wformat-invalid-specifier]
5 | printf("%w64d\n", INT64_C(0));
| ~~^
```
My version is 18.0.0git 6452395561ea.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykU02PpDYQ_TXFpQQCu23gwKGH3o72kJwi7TEytgFn3XbLNt0zOexvj6A_ZjJKcllkGcr1wat6fiJGMzmtO2AvwA6ZWNLsQxdjusprNnj11vX-dDbWuAnTbCJKrzRO5qIjCryK4IybCsSvqF_PWiZ0_sPpL32PyuuIzqct6T0Ho3FS40WHaLzDiq5FElrvv0e05rvGNGscg3cJtVPvZYKWfnLmrzVAJIxnLc1odIg4-oD6VciUX41KM6a384oyaBTW-qtWBZQHKPf3nZe31d9tQo2TdlEagfYxKeNSMQP98l9u_9G77cYlPAnjgDQXbxSQFqF-ufnwHIxLI5AGCAHCrnyngPVus3r8-tvvfPdHD6QpgbTroo9EDDotwWH5PIL68KmHf23sZkor3IT5N2Et5jEpoAdJXm9wCnmLeRh0z4DuKwp0_-Bp_TTuIqxRKL178PUcOwKpOZAagb3k30YfTiLl94T8GQXsjhgZQt0j_sQ41met8eMHsC__M4df3563y0SsmqIsyskk5DtGaMsYr7QoMtVR1dJWZLqr6pIyXjVtm80dr5p6rDgba14SpdiubZtRM0nHQYhhGDLTkZLQihBeUtpUbTHysaEtJZxJRjmXsCv1SRhbWHs5FT5MmYlx0V3NaV1nVgzaxk13hGwcra2zQxa6NT4flinCrrQmpvheIZlkdddvlMbZL1Ztmli5QjH4Jf1DAJ-0cRt5tgTbzSmdI9A9kCOQ42TSvAyF9Ccgx_Vf91d-Dv5PLROQ4wY9Ajlu6P8OAAD__zxYRPk">