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

Takuya Shimizu via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 11 04:05:35 PST 2023


hazohelet wrote:

> I need to extend the tablegen backend ClangDiagnosticsEmitter with some kind of new option to handle this, right?

Alternatively, you could probably use `DiagnosticsEngine::isIgnored` to check if the `-Wformat-signedness` is enabled or not, and control whether `MatchSignedNess` is `NoMatch` or `Match`, as your first implementation did.
This way we can achieve GCC compatibility for 1, 2, 3, 4, 6, 7, while benefitting from a real warning flag.
However, in this implementation `-Wformat-signedness` would be an _dummy warning_ which never gets emitted. As far as I know, there isn't anything similar in the codebase, so it might not be the ideal way.

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


More information about the cfe-commits mailing list