ESP_OTA_GitHub icon indicating copy to clipboard operation
ESP_OTA_GitHub copied to clipboard

Fixed compile error and warnings

Open bertbaron opened this issue 3 years ago • 1 comments

Fixes for the following errors and warnings I got with recent platformio:

In file included from src/esp8266_ota.cpp:4:
.pio/libdeps/d1_mini_lite/ESP OTA GitHub/src/ESP_OTA_GitHub.h:26:1: warning: 'typedef' was ignored in this declaration
   26 | typedef struct urlDetails_t {
.pio/libdeps/d1_mini_lite/ESP OTA GitHub/src/ESP_OTA_GitHub.cpp: In member function 'bool ESPOTAGitHub::checkUpgrade()':
.pio/libdeps/d1_mini_lite/ESP OTA GitHub/src/ESP_OTA_GitHub.cpp:178:25: warning: unused variable 'release_name' [-Wunused-variable]
  178 |             const char* release_name = doc["name"];
.pio/libdeps/d1_mini_lite/ESP OTA GitHub/src/ESP_OTA_GitHub.cpp: In member function 'bool ESPOTAGitHub::doUpgrade()':
.pio/libdeps/d1_mini_lite/ESP OTA GitHub/src/ESP_OTA_GitHub.cpp:237:52: error: control reaches end of non-void function [-Werror=return-type]
  237 |     urlDetails_t splitURL = _urlDetails(_upgradeURL);

The last one is an error which makes the build fail so it would be nice if this could at least be fixed.

bertbaron avatar Sep 26 '21 07:09 bertbaron

Hi @bertbaron

Thank you for taking the time not only to point out the issue but also to create a PR, much appreciated.

Happy to merge once I've checked that it will still compile in ArduinoIDE without the "typedef" on L26 of ESP_OTA_GitHub.h. I'll try and run a test in the next couple of days.

I'd prefer to comment out L178 of ESP_OTA_GitHub.cpp rather than delete it, in case there is a desire to use the name for future functionality, but it can always be added in later if required.

Kind Regards,

Gavin.

yknivag avatar Sep 28 '21 13:09 yknivag