[Lldb-commits] [lldb] 2f18e51 - [lldb] Silence GCC warnings about format not being a string literal in LLDB_SCOPED_TIMER
Martin Storsjö via lldb-commits
lldb-commits at lists.llvm.org
Tue Mar 23 05:12:12 PDT 2021
Author: Martin Storsjö
Date: 2021-03-23T14:11:50+02:00
New Revision: 2f18e51d8b9e02d689efc522a0784caed5b5a386
URL: https://github.com/llvm/llvm-project/commit/2f18e51d8b9e02d689efc522a0784caed5b5a386
DIFF: https://github.com/llvm/llvm-project/commit/2f18e51d8b9e02d689efc522a0784caed5b5a386.diff
LOG: [lldb] Silence GCC warnings about format not being a string literal in LLDB_SCOPED_TIMER
Pass "%s" as the format string literal and LLVM_PRETTY_FUNCTION as
argument to it.
Differential Revision: https://reviews.llvm.org/D99120
Added:
Modified:
lldb/include/lldb/Utility/Timer.h
Removed:
################################################################################
diff --git a/lldb/include/lldb/Utility/Timer.h b/lldb/include/lldb/Utility/Timer.h
index edc064b23b574..32422b34b1adf 100644
--- a/lldb/include/lldb/Utility/Timer.h
+++ b/lldb/include/lldb/Utility/Timer.h
@@ -76,7 +76,7 @@ class Timer {
#define LLDB_SCOPED_TIMER() \
static ::lldb_private::Timer::Category _cat(LLVM_PRETTY_FUNCTION); \
- ::lldb_private::Timer _scoped_timer(_cat, LLVM_PRETTY_FUNCTION)
+ ::lldb_private::Timer _scoped_timer(_cat, "%s", LLVM_PRETTY_FUNCTION)
#define LLDB_SCOPED_TIMERF(...) \
static ::lldb_private::Timer::Category _cat(LLVM_PRETTY_FUNCTION); \
::lldb_private::Timer _scoped_timer(_cat, __VA_ARGS__)
More information about the lldb-commits
mailing list