[clang] [llvm] [Sema] Implement support for -Wformat-signedness (PR #74440)
Karl-Johan Karlsson via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 11 05:42:39 PST 2023
karka228 wrote:
> 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.
A bit ugly with a _dummy warning_, but it simplifies the implementation. What do you other think? Is this an acceptable solution or not?
https://github.com/llvm/llvm-project/pull/74440
More information about the cfe-commits
mailing list