[clang] Fix Clang bug that -Wformat-signedness is not reported properly. (PR #150962)
Karl-Johan Karlsson via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 5 01:36:03 PDT 2025
karka228 wrote:
First a general note. The reason why -Wformat-signedness is implemented a bit weird in clang is that we wanted the warning to be more or less compatible with how it is implemented in gcc. That way a user that change from gcc to clang (or use compile with both clang and gcc) don't run into any undesirable surprises.
The original discussion about gcc compatibility can be found in the original PR https://github.com/llvm/llvm-project/pull/74440
With that said, the clang implementation isn't entirely compatible with gcc and we can if we want introduce new incompatibilities if we find it reasonable.
I have only looked briefly on your patch and I think the added ", which differs in signedness" to the warning message is a good thing.
https://github.com/llvm/llvm-project/pull/150962
More information about the cfe-commits
mailing list