Skip to content

Commit 9f7a587

Browse files
authored
[lldb-dap] Fix formatting chrono::seconds warning. (#137371)
Updated the format to use `llvm::formatv` instead of printf style format.
1 parent be7ef6c commit 9f7a587

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lldb/tools/lldb-dap/DAP.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "llvm/ADT/StringExtras.h"
3636
#include "llvm/ADT/StringRef.h"
3737
#include "llvm/ADT/Twine.h"
38+
#include "llvm/Support/Chrono.h"
3839
#include "llvm/Support/Error.h"
3940
#include "llvm/Support/ErrorHandling.h"
4041
#include "llvm/Support/FormatVariadic.h"
@@ -976,9 +977,10 @@ lldb::SBError DAP::WaitForProcessToStop(std::chrono::seconds seconds) {
976977
}
977978
std::this_thread::sleep_for(std::chrono::microseconds(250));
978979
}
979-
error.SetErrorStringWithFormat("process failed to stop within %" PRId64
980-
" seconds",
981-
static_cast<uint64_t>(seconds.count()));
980+
error.SetErrorString(
981+
llvm::formatv("process failed to stop within {0}", seconds)
982+
.str()
983+
.c_str());
982984
return error;
983985
}
984986

0 commit comments

Comments
 (0)