tbaeder added a comment. Can't say much about the rest of the patch so I'd defer to someone else. Since gcc has `-Wformat-truncation`, can we disable this warning in clang as well? Can you add a test for that?
================ Comment at: clang/lib/Sema/SemaChecking.cpp:1136-1137 + [&](const Expr *FormatExpr, StringRef &FormatStrRef, size_t &StrLen) { + if (auto *Format = dyn_cast<StringLiteral>(FormatExpr)) { + if (!Format->isOrdinary() && !Format->isUTF8()) + return false; ---------------- ================ Comment at: clang/lib/Sema/SemaChecking.cpp:1325 DestinationSize = ComputeSizeArgument(0); + const auto *FormatExpr = TheCall->getArg(/*Arg=*/2)->IgnoreParenImpCasts(); + StringRef FormatStrRef; ---------------- (Really not a fan of this, it adds nothing). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158562/new/ https://reviews.llvm.org/D158562 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits