[openthread] Fix compiler format warning#14030
Conversation
|
To use the changes from this PR as an external component, add the following to your ESPHome configuration YAML file: external_components:
- source: github://pr#14030
components: [openthread]
refresh: 1h(Added by the PR bot) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #14030 +/- ##
=======================================
Coverage 74.08% 74.08%
=======================================
Files 55 55
Lines 11588 11588
Branches 1577 1577
=======================================
Hits 8585 8585
Misses 2600 2600
Partials 403 403 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Memory Impact AnalysisComponents:
This analysis runs automatically when components change. Memory usage is measured from a representative test configuration. |
|
👋 Hi there! This PR modifies 1 file(s) with codeowners. @mrene - As codeowner(s) of the affected files, your review would be appreciated! 🙏 Note: Automatic review request may have failed, but you're still welcome to review. |
|
Thanks |
What does this implement/fix?
ESPHome Version: e.g. 2026.2.0b3
openthreadmodule raises gcc format warning (or error if enforced via-Werror) if configured as MTD with DEBUG logging.--> Try to compile provided yaml below
In file included from src/esphome/core/component.h:9, from src/esphome/core/automation.h:3, from src/esphome/components/mdns/mdns_component.h:5, from src/esphome/components/openthread/openthread.h:5, from src/esphome/components/openthread/openthread_esp.cpp:4: src/esphome/components/openthread/openthread_esp.cpp: In member function 'void esphome::openthread::OpenThreadComponent::ot_main()': src/esphome/components/openthread/openthread_esp.cpp:118:19: error: format '%d' expects argument of type 'int', but argument 5 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=] 118 | ESP_LOGD(TAG, "Link Polling Period: %d", link_polling_period); | ^~~~~~~~~~~~~~~~~~~~~~~~~End user impact: Likely none on wrong arg interpretation, in worst case bad output. Here only signed vs unsigned.
Developer impact: Slightly annoying if to compile tree with strict warnings for enforcing QA.
Format fix is obvious.
Types of changes
Related issue or feature (if applicable):
Pull request in esphome-docs with documentation (if applicable):
Test Environment
Example entry for
config.yaml:Checklist:
tests/folder).If user exposed functionality or configuration variables are added/changed: