[clang] [llvm] [Sema] Implement support for -Wformat-signedness (PR #74440)
Karl-Johan Karlsson via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 18 08:18:28 PST 2023
================
@@ -11881,6 +11896,8 @@ CheckPrintfHandler::checkFormatExpr(const analyze_printf::PrintfSpecifier &FS,
ICE->getType() == S.Context.UnsignedIntTy) {
// All further checking is done on the subexpression
ImplicitMatch = AT.matchesType(S.Context, ExprTy);
----------------
karka228 wrote:
After more testing I have found out that this call to AT.matchesTypes (row 11898) can introduce new normal -Wformat warnings that should not occur. This happens if the above call to AT.matchesTypes (row 11875) return ArgType::NoMatchSignedness that is not returned at this call to AT.matchesTypes (row 11898) as we are looking through the promoted int type, but instead we get ArgType::NoMatch returned.
This mean that if the original AT.matchesTypes at row 11875 return a signedness match then this this call to AT.matchesTypes (row 11898) also must return a signedness match for us to report a new warning, otherwise we might introduce unwanted warnings. I will update the code to fix this ...
https://github.com/llvm/llvm-project/pull/74440
More information about the llvm-commits
mailing list