[clang] [llvm] [Sema] Implement support for -Wformat-signedness (PR #74440)

Jon Roelofs via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 11 09:23:22 PST 2024


jroelofs wrote:

I think this diagnostic should not be firing on `%x` format specifiers:

https://clang.godbolt.org/z/YGh1qdq1h

```
#include <stdio.h>

void bad() {
    int u = 0;
    printf("%x\n", u);
}
```

```
<source>:5:20: warning: format specifies type 'unsigned int' but the argument has type 'int' [-Wformat]
    5 |     printf("%x\n", u);
      |             ~~     ^
      |             %x
1 warning generated.
```

https://github.com/llvm/llvm-project/pull/74440


More information about the cfe-commits mailing list