From f1ded6ff887be847f9dfa0398a61bfb8a538dfe7 Mon Sep 17 00:00:00 2001 From: Herve Eruam Date: Thu, 12 Dec 2024 11:32:12 +0100 Subject: [PATCH] Fix warnings. --- .../log/sentry/abstractcounterscopedptrace.h | 2 +- src/libcommon/log/sentry/ptraces.h | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/libcommon/log/sentry/abstractcounterscopedptrace.h b/src/libcommon/log/sentry/abstractcounterscopedptrace.h index 8d5d50eb4..b5e81ed2e 100644 --- a/src/libcommon/log/sentry/abstractcounterscopedptrace.h +++ b/src/libcommon/log/sentry/abstractcounterscopedptrace.h @@ -40,7 +40,7 @@ class AbstractCounterScopedPTrace : public AbstractScopedPTrace { AbstractScopedPTrace(info, PTraceStatus::Cancelled, syncDbId), _nbOfCyclesPerTrace(nbOfCyclePerTrace) {} private: - void stop(PTraceStatus status = PTraceStatus::Ok) final { + void stop([[maybe_unused]] PTraceStatus status = PTraceStatus::Ok) final { assert(false && "stop() should not be called with CounterScopedPTrace."); } void restart() final { diff --git a/src/libcommon/log/sentry/ptraces.h b/src/libcommon/log/sentry/ptraces.h index 1d2859311..0ab6ee189 100644 --- a/src/libcommon/log/sentry/ptraces.h +++ b/src/libcommon/log/sentry/ptraces.h @@ -24,11 +24,14 @@ namespace KDC::sentry::pTraces { struct None : public AbstractPTrace { - None() = default; - None(int syncdbId) : AbstractPTrace({}, syncdbId) {} - void start() final {} - void stop(PTraceStatus status = PTraceStatus::Ok) final {} - void restart() final {} + None() : AbstractPTrace({}){}; + explicit None(int syncdbId) : AbstractPTrace({}, syncdbId) {} + void start() final { /* Do nothing */ + } + void stop([[maybe_unused]] PTraceStatus status = PTraceStatus::Ok) final { /* Do nothing */ + } + void restart() final { /* Do nothing */ + } }; /*