From 140e8ebfc29694f4755af5534344750ead570468 Mon Sep 17 00:00:00 2001 From: abin Date: Thu, 17 Sep 2026 22:58:40 +0800 Subject: [PATCH] fix: suppress unused result warnings in exception handling --- include/simple_timer/simple_timer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/simple_timer/simple_timer.h b/include/simple_timer/simple_timer.h index 8194df8..0f34671 100644 --- a/include/simple_timer/simple_timer.h +++ b/include/simple_timer/simple_timer.h @@ -299,12 +299,12 @@ class SimpleTimer { catch (const std::exception &e) { state_ = State::Stopped; - std::fprintf(stderr, "\n\033[1;31m[SimpleTimer] Exception: %s\033[0m\n\n", e.what()); + static_cast(std::fprintf(stderr, "\n\033[1;31m[SimpleTimer] Exception: %s\033[0m\n\n", e.what())); } catch (...) { state_ = State::Stopped; - std::fprintf(stderr, "\n\033[1;31m[SimpleTimer] Unknown exception occurred.\033[0m\n\n"); + static_cast(std::fprintf(stderr, "\n\033[1;31m[SimpleTimer] Unknown exception occurred.\033[0m\n\n")); } lock.lock();