From a9578637cb381cc646317394c555830ec33a3724 Mon Sep 17 00:00:00 2001 From: Michael Ammann Date: Fri, 3 Jan 2025 21:28:34 +0100 Subject: [PATCH] avoid unused-variable warning Avoid warning when compiled with All warnings enabled. .../src/NimBLEScan.cpp: In member function 'void NimBLEScanResults::dump() const': .../src/NimBLEScan.cpp:481:22: warning: unused variable 'dev' [-Wunused-variable] 481 | for (const auto& dev : m_deviceVec) { | ^~~ --- src/NimBLEScan.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/NimBLEScan.cpp b/src/NimBLEScan.cpp index 8abaf01..16b46cf 100644 --- a/src/NimBLEScan.cpp +++ b/src/NimBLEScan.cpp @@ -478,9 +478,11 @@ void NimBLEScan::clearResults() { * @brief Dump the scan results to the log. */ void NimBLEScanResults::dump() const { +#if CONFIG_NIMBLE_CPP_LOG_LEVEL >=3 for (const auto& dev : m_deviceVec) { NIMBLE_LOGI(LOG_TAG, "- %s", dev->toString().c_str()); } +#endif } // dump /**