From: Chris Lattner Date: Sun, 26 Aug 2007 17:38:22 +0000 (+0000) Subject: For warnings like this: X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a9e2ea107d9419a6406f01e513679327032da193;p=clang For warnings like this: t.c:3:9: warning: invalid conversion '%B' printf("%B\a\n", p); ~~~~~~ ^ Don't beep the console or print the newline. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41453 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Sema/SemaChecking.cpp b/Sema/SemaChecking.cpp index cc682af99f..d5445a17ee 100644 --- a/Sema/SemaChecking.cpp +++ b/Sema/SemaChecking.cpp @@ -365,7 +365,8 @@ Sema::CheckPrintfArguments(Expr *Fn, LastConversionIdx+1); Diag(Loc, diag::warn_printf_invalid_conversion, - std::string(Str+LastConversionIdx, Str+StrIdx), + std::string(Str+LastConversionIdx, + Str+std::min(LastConversionIdx+2, StrLen)), Fn->getSourceRange()); return; }