summaryrefslogtreecommitdiffstats
path: root/clang/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-08-26 17:38:22 +0000
committerChris Lattner <sabre@nondot.org>2007-08-26 17:38:22 +0000
commit0d850bfed89fdf80b15565a6d6222086196d9289 (patch)
tree29ffd5cbee4acc0f5ec3d736b33ca35933da572d /clang/Sema/SemaChecking.cpp
parent9decfbabd34e7d272b77a86c77ec9b7d1a091b3d (diff)
downloadbcm5719-llvm-0d850bfed89fdf80b15565a6d6222086196d9289.tar.gz
bcm5719-llvm-0d850bfed89fdf80b15565a6d6222086196d9289.zip
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. llvm-svn: 41453
Diffstat (limited to 'clang/Sema/SemaChecking.cpp')
-rw-r--r--clang/Sema/SemaChecking.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/Sema/SemaChecking.cpp b/clang/Sema/SemaChecking.cpp
index cc682af99f0..d5445a17eea 100644
--- a/clang/Sema/SemaChecking.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud