Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid unused-variable warning #834

Merged
merged 2 commits into from
Jan 4, 2025
Merged

avoid unused-variable warning #834

merged 2 commits into from
Jan 4, 2025

Conversation

mazgch
Copy link
Contributor

@mazgch mazgch commented Jan 3, 2025

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) {
      |                      ^~~

alternatively the #if could even wrap the whole for loop ...

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) {
      |                      ^~~
@h2zero
Copy link
Owner

h2zero commented Jan 3, 2025

Thanks! I thought I had fixed this already but I guess it didn't get merged. Could you change this to just wrap the loop with #if CONFIG_NIMBLE_CPP_LOG_LEVEL >=3 please?

@mazgch
Copy link
Contributor Author

mazgch commented Jan 4, 2025

I changed as per your request.

@h2zero
Copy link
Owner

h2zero commented Jan 4, 2025

Thanks!

@h2zero h2zero merged commit f4746f2 into h2zero:master Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants