From 877f6016faa8267f8e798b812ebf72d9b4397246 Mon Sep 17 00:00:00 2001 From: Honggyu Kim Date: Sat, 15 Apr 2023 20:32:02 +0900 Subject: [PATCH] heaptrace: Resolve some warnings found by clang-tidy This patch fixes the following clang-tidy warnings. src/heaptrace.cc:117:8: warning: Value stored to 'old_libpath' during its initialization is never read src/libheaptrace.cc:71:8: warning: Value stored to 'tfs' during its initialization is never read src/libheaptrace.cc:171:24: warning: function previously declared with an explicit exception specification red eclared with an implicit exception specification src/libheaptrace.cc:189:24: warning: function previously declared with an explicit exception specification red eclared with an implicit exception specification src/stacktrace.cc:310:10: warning: Value stored to 'count' during its initialization is never read src/utils.cc:24:2: warning: Value stored to 'ret' is never read Signed-off-by: Honggyu Kim --- src/heaptrace.cc | 1 - src/libheaptrace.cc | 5 ++--- src/stacktrace.cc | 1 - src/utils.cc | 6 ++++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/heaptrace.cc b/src/heaptrace.cc index 41b4d1a..614258d 100644 --- a/src/heaptrace.cc +++ b/src/heaptrace.cc @@ -114,7 +114,6 @@ static void setup_child_environ(struct opts *opts, int argc, char *argv[]) std::stringstream ss; char buf[4096]; char *old_preload = getenv("LD_PRELOAD"); - char *old_libpath = getenv("LD_LIBRARY_PATH"); if (!access("libheaptrace.so", X_OK)) ss << "./"; diff --git a/src/libheaptrace.cc b/src/libheaptrace.cc index 332b531..a9e9968 100644 --- a/src/libheaptrace.cc +++ b/src/libheaptrace.cc @@ -68,7 +68,6 @@ FILE *outfp; __constructor static void heaptrace_init() { - auto *tfs = &thread_flags; int pid = getpid(); std::stringstream ss; std::string comm = utils::get_comm_name(); @@ -169,7 +168,7 @@ __visible_default void *operator new[](size_t size) return p; } -__visible_default void operator delete(void *ptr) +__visible_default void operator delete(void *ptr) noexcept { auto *tfs = &thread_flags; @@ -187,7 +186,7 @@ __visible_default void operator delete(void *ptr) tfs->hook_guard = false; } -__visible_default void operator delete[](void *ptr) +__visible_default void operator delete[](void *ptr) noexcept { auto *tfs = &thread_flags; diff --git a/src/stacktrace.cc b/src/stacktrace.cc index afbc7d4..1f25289 100644 --- a/src/stacktrace.cc +++ b/src/stacktrace.cc @@ -307,7 +307,6 @@ print_dump_stackmap_flamegraph(std::vector