diff --git a/include/xrpl/telemetry/Recording.h b/include/xrpl/telemetry/Recording.h index 105890126a..9c8f8bfac1 100644 --- a/include/xrpl/telemetry/Recording.h +++ b/include/xrpl/telemetry/Recording.h @@ -252,12 +252,10 @@ public: * @param value The value to remember. */ void - store(T const& value) noexcept + store([[maybe_unused]] T const& value) noexcept { #ifdef XRPL_ENABLE_TELEMETRY value_ = value; -#else - (void)value; #endif } @@ -270,14 +268,13 @@ public: * False when compiled out, so a caller's reporting branch never runs. */ [[nodiscard]] bool - changedTo(T const& value) noexcept + changedTo([[maybe_unused]] T const& value) noexcept { #ifdef XRPL_ENABLE_TELEMETRY bool const changed = value_ != value; value_ = value; return changed; #else - (void)value; return false; #endif } diff --git a/src/libxrpl/basics/MallocTrim.cpp b/src/libxrpl/basics/MallocTrim.cpp index 885d857984..73d18f11e7 100644 --- a/src/libxrpl/basics/MallocTrim.cpp +++ b/src/libxrpl/basics/MallocTrim.cpp @@ -77,7 +77,7 @@ parseStatmRSSkB(std::string const& statm) * @param path Absolute path of the pseudo-file. * @return The file contents, or an empty string if it could not be opened. */ -std::string +[[nodiscard]] std::string readProcFile(std::string const& path) { std::ifstream ifs(path, std::ios::in | std::ios::binary); @@ -103,7 +103,7 @@ readProcFile(std::string const& path) * @return A fully populated report. Fields whose source syscall failed keep * their -1 "not measured" sentinel. */ -MallocTrimReport +[[nodiscard]] MallocTrimReport measuredTrim(std::size_t padBytes) { MallocTrimReport report;