| Issue |
63867
|
| Summary |
Clang warning insists on changing format specifier from `%u` to `%u`
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
johnstiles-google
|
Test case: https://godbolt.org/z/aW3Eax35r
We have code that uses `printf` to output an `enum class : unsigned int` with a `%u` format specifier:
```
enum class E : unsigned int {
A, B, C
};
void test(E e) {
printf("%u", e);
}
```
Previously (clang 16.0.0) this was benign and compiled without incident. On clang-trunk in -Wall we get an incorrect warning:
```
<source>:8:18: warning: format specifies type 'unsigned int' but the argument has type 'E' [-Wformat]
8 | printf("%u", e);
| ~~ ^
| %u
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs