golioth / golioth-firmware-sdk

Firmware SDK enabling any IoT device to connect to Golioth - the Universal Connector for IoT
https://golioth.io
Apache License 2.0
60 stars 11 forks source link

Build error in function 'coap_notify_observers': #196

Closed kaevee closed 1 year ago

kaevee commented 1 year ago

Golioth Firmware SDK Commit Hash

f2bade298fb44ed41232e1f5214476eb6bb99d58

Platform/OS

ESP-IDF v5.1.1

Hardware Target

ESP32

What host OS are you using?

Windows 11 Version 22H2 OS Build 22621.2283

Current Behavior

I am trying to build examples/esp_idf/golioth_basics using ESP-IDF 5.1.1. The build fails with errors.

Expected Behavior

No response

Steps To Reproduce

git clone --recursive https://github.com/golioth/golioth-firmware-sdk.git cd golioth-firmware-sdk git checkout v0.7.0 cd examples\esp_idf\golioth_basics idf.py build

Logs, console output, or any kind of debug information

C:/Users/EspDev/Devel/EspressIF/Projects/golioth-firmware-sdk/external/libcoap/src/resource.c: In function 'coap_notify_observers':
C:/Users/EspDev/Devel/EspressIF/Projects/golioth-firmware-sdk/external/libcoap/src/resource.c:983:11: error: 'token' may be used uninitialized [-Werror=maybe-uninitialized]
  983 |           coap_delete_observer(r, obs->session, &token);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/EspDev/Devel/EspressIF/Projects/golioth-firmware-sdk/external/libcoap/src/resource.c:817:1: note: by argument 3 of type 'const coap_bin_const_t *' to 'coap_delete_observer' declared here
  817 | coap_delete_observer(coap_resource_t *resource, coap_session_t *session,
      | ^~~~~~~~~~~~~~~~~~~~
C:/Users/EspDev/Devel/EspressIF/Projects/golioth-firmware-sdk/external/libcoap/src/resource.c:871:20: note: 'token' declared here
  871 |   coap_bin_const_t token;
      |                    ^~~~~
cc1.exe: some warnings being treated as errors
hasheddan commented 1 year ago

Hi @kaevee! Thanks for reporting this issue 🙂 This is due to changes in esp-idf v5.1.1, but has been addressed on main and will be included in the forthcoming (today) v0.8.0 Golioth Firmware SDK release.

See https://github.com/golioth/golioth-firmware-sdk/pull/171#issuecomment-1711864269 for more details.

kaevee commented 1 year ago

Hi @hasheddan Thank you very much for the information. I will wait for the release.

sam-golioth commented 1 year ago

v0.8.0 is now available!