summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Drummond <luke.drummond@codeplay.com>2016-12-22 19:15:07 +0000
committerLuke Drummond <luke.drummond@codeplay.com>2016-12-22 19:15:07 +0000
commit63dea591040f8dad31a1b3942afcb5b12537ef90 (patch)
tree82e42f09ecaeddd41a5451af5a5831cfab365591
parentc2b56634cfae06e4c2c373b96bc4da144adfe86f (diff)
downloadbcm5719-llvm-63dea591040f8dad31a1b3942afcb5b12537ef90.tar.gz
bcm5719-llvm-63dea591040f8dad31a1b3942afcb5b12537ef90.zip
Fix a couple of incorrect format string warnings
This patch fixes use of incorrect `%zi` to format a plain `int`, and using `%llu` to format a `uint64_t`. The fix is to use the new typesafe `llvm::Formatv` based API. Differential Revision: https://reviews.llvm.org/D28028 Subscribers: lldb-commits llvm-svn: 290359
-rw-r--r--lldb/source/Interpreter/Args.cpp5
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp4
2 files changed, 4 insertions, 5 deletions
diff --git a/lldb/source/Interpreter/Args.cpp b/lldb/source/Interpreter/Args.cpp
index c428a2352ca..698432885d9 100644
--- a/lldb/source/Interpreter/Args.cpp
+++ b/lldb/source/Interpreter/Args.cpp
@@ -213,10 +213,9 @@ void Args::Dump(Stream &s, const char *label_name) const {
int i = 0;
for (auto &entry : m_entries) {
s.Indent();
- s.Printf("%s[%zi]=\"%*s\"\n", label_name, i++, int(entry.ref.size()),
- entry.ref.data());
+ s.Format("{0}[{1}]=\"{2}\"\n", label_name, i++, entry.ref);
}
- s.Printf("%s[%zi]=NULL\n", label_name, i);
+ s.Format("{0}[{1}]=NULL\n", label_name, i);
s.EOL();
}
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp b/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
index 4f41c8ebcbc..356e2e7eba2 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
@@ -513,8 +513,8 @@ bool IRForTarget::RewriteObjCConstString(llvm::GlobalVariable *ns_str,
default:
encoding_flags = 0x0600; /* fall back to 0x0600, kCFStringEncodingASCII */
if (log) {
- log->Printf("Encountered an Objective-C constant string with unusual "
- "element size %llu",
+ log->Format("Encountered an Objective-C constant string with unusual "
+ "element size {0}",
string_array->getElementByteSize());
}
}
OpenPOWER on IntegriCloud