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

Karl-Johan Karlsson via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 25 00:54:15 PDT 2024


karka228 wrote:

> Can you also add a test showing the difference between `-Wformat -Wformat-signedness` and `-Wformat-signedness` by itself (which does nothing)?

With the current implementation `-Wformat-signedness` by itself actually turn on the signedness warnings. This is not compatible with how gcc do it. I guess I have thought that it was not that important to be compatible with gcc in this respect. However if it is I guess this could be implemented.

> I'd also like to see a test demonstrating that `#pragma GCC diagnostic ignored -Wformat` disables the signedness warnings.

There is a single test in the end of clang/test/Sema/format-strings-signedness.c that demonstrate this.


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


More information about the cfe-commits mailing list