Skip to content

Warnings when compiling with ESPHome 2026.8.1 #53

Closed

Description

@KrzysztofHajdamowicz

I'm tinkering with https://github.com/MariuszWoszczynski/WMBUS-reader/blob/main/WMBUS-reader-zigbee.yaml
Build environment is ESPHome 2026.8.1.
Compiler warns about casting between potentially incompatible data types:

[1236/1291] Building CXX object esp-idf/src/CMakeFiles/__idf_src.dir/esphome/components/wmbus_common/formula.cpp.obj
../src/esphome/components/wmbus_common/formula.cpp: In member function 'Token* FormulaImplementation::LA(size_t)':
../src/esphome/components/wmbus_common/formula.cpp:870:11: warning: comparison of unsigned expression in '< 0' is always false [-Wtype-limits]
  870 |     if (i < 0 || i >= tokens_.size()) return NULL;
      |         ~~^~~
[1257/1291] Building CXX object esp-idf/src/CMakeFiles/__idf_src.dir/esphome/components/wmbus_common/meters.cpp.obj
../src/esphome/components/wmbus_common/meters.cpp: In member function 'virtual std::string MeterCommonImplementation::unixTimestampOfUpdate()':
../src/esphome/components/wmbus_common/meters.cpp:633:35: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'time_t' {aka 'long long int'} [-Wformat=]
  633 |     snprintf(ut, sizeof(ut)-1, "%lu", datetime_of_update_);
      |                                 ~~^   ~~~~~~~~~~~~~~~~~~~
      |                                   |   |
      |                                   |   time_t {aka long long int}
      |                                   long unsigned int
      |                                 %llu
../src/esphome/components/wmbus_common/meters.cpp: In member function 'virtual bool MeterCommonImplementation::handleTelegram(AboutTelegram&, std::vector<unsigned char>, bool, std::vector<Address>*, bool*, Telegram*)':
../src/esphome/components/wmbus_common/meters.cpp:999:51: warning: implicitly-declared 'Telegram& Telegram::operator=(const Telegram&)' is deprecated [-Wdeprecated-copy]
  999 |         if (out_analyzed != NULL) *out_analyzed = t;
      |                                                   ^
In file included from ../src/esphome/components/wmbus_common/meters.h:27,
                 from ../src/esphome/components/wmbus_common/meters.cpp:18:
../src/esphome/components/wmbus_common/wmbus.h:350:5: note: because 'Telegram' has user-provided 'Telegram::Telegram(Telegram&)'
  350 |     Telegram(Telegram&t) { }
      |     ^~~~~~~~
../src/esphome/components/wmbus_common/meters.cpp:1025:47: warning: implicitly-declared 'Telegram& Telegram::operator=(const Telegram&)' is deprecated [-Wdeprecated-copy]
 1025 |     if (out_analyzed != NULL) *out_analyzed = t;
      |                                               ^
../src/esphome/components/wmbus_common/wmbus.h:350:5: note: because 'Telegram' has user-provided 'Telegram::Telegram(Telegram&)'
  350 |     Telegram(Telegram&t) { }
      |     ^~~~~~~~
[121/122] Generating binary image from built executable

and

[1280/1291] Building CXX object esp-idf/src/CMakeFiles/__idf_src.dir/wmbusmeters_drivers/amiplus.cpp.obj
../src/wmbusmeters_drivers/amiplus.cpp:46:5: warning: '{anonymous}::Driver::Driver(MeterInfo&, DriverInfo&)' defined but not used [-Wunused-function]
   46 |     Driver::Driver(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementation(mi, di)
      |     ^~~~~~
[1281/1291] Building CXX object esp-idf/src/CMakeFiles/__idf_src.dir/wmbusmeters_drivers/apator162.cpp.obj
../src/wmbusmeters_drivers/apator162.cpp:45:5: warning: '{anonymous}::Driver::Driver(MeterInfo&, DriverInfo&)' defined but not used [-Wunused-function]
   45 |     Driver::Driver(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementation(mi, di)
      |     ^~~~~~
[1287/1291] Generating binary image from built executable

Activity

  1. kubasaw commented on Aug 26, 2026

    @kubasaw
    Member

    These warnings originate directly from the upstream wmbusmeters core codebase, which is integrated here as a git subtree. Our maintenance strategy is to keep only the absolute minimal set of modifications necessary to make it work, avoiding unnecessary divergence from upstream.

    Following the release of wmbusmeters 2.0+, this part of the component is slated for a significant refactor to align with the new upstream changes. At the moment, I can't provide a concrete ETA for when this overhaul will land, but because of it, we won't be investing time into patching compiler warnings in the current legacy code—they don't impact runtime functionality, and the code is scheduled to be replaced anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions