================ @@ -2292,6 +2292,18 @@ class UnsafeBufferUsageReporter : public UnsafeBufferUsageHandler { } } + void handleUnsafeLibcCall(const CallExpr *Call, unsigned PrintfInfo, + ASTContext &Ctx) override { + // We have checked that there is a direct callee with an identifier name: + StringRef Name = Call->getDirectCallee()->getName(); + + S.Diag(Call->getBeginLoc(), diag::warn_unsafe_buffer_libc_call) + << Name << Call->getSourceRange(); ---------------- haoNoQ wrote:
Just pass `const Decl *D = Call->getDirectCallee()` directly into `S.Diag()`. It even automatically adds quotes around the name this way. https://github.com/llvm/llvm-project/pull/101583 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits