[cfe-commits] r41453 - /cfe/trunk/Sema/SemaChecking.cpp
Chris Lattner
sabre at nondot.org
Sun Aug 26 10:38:22 PDT 2007
Author: lattner
Date: Sun Aug 26 12:38:22 2007
New Revision: 41453
URL: http://llvm.org/viewvc/llvm-project?rev=41453&view=rev
Log:
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.
Modified:
cfe/trunk/Sema/SemaChecking.cpp
Modified: cfe/trunk/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaChecking.cpp?rev=41453&r1=41452&r2=41453&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/Sema/SemaChecking.cpp Sun Aug 26 12:38:22 2007
@@ -365,7 +365,8 @@
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;
}
More information about the cfe-commits
mailing list