Unable to compile HTTPClient for ESP32 (BSP 2.0.4)
The latest ESP32 BSP (2.0.4) increases the compiler warn level in which causes compilation with this library to fail due to the following errors:
esp32:esp32 2.0.4 /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.4
/home/runner/Arduino/libraries/ArduinoHttpClient/src/HttpClient.cpp: In member function 'int HttpClient::startRequest(const char*, const char*, const char*, int, const byte*)':
/home/runner/Arduino/libraries/ArduinoHttpClient/src/HttpClient.cpp:87:61: error: logical not is only applied to the left hand side of comparison [-Werror=logical-not-parentheses]
if (!iClient->connect(iServerName, iServerPort) > 0)
^
/home/runner/Arduino/libraries/ArduinoHttpClient/src/HttpClient.cpp:87:17: note: add parentheses around left hand side expression to silence this warning
if (!iClient->connect(iServerName, iServerPort) > 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
( )
/home/runner/Arduino/libraries/ArduinoHttpClient/src/HttpClient.cpp:97:[64](https://github.com/brentru/Adafruit_IO_Arduino/runs/7751465143?check_suite_focus=true#step:7:65): error: logical not is only applied to the left hand side of comparison [-Werror=logical-not-parentheses]
if (!iClient->connect(iServerAddress, iServerPort) > 0)
^
/home/runner/Arduino/libraries/ArduinoHttpClient/src/HttpClient.cpp:97:17: note: add parentheses around left hand side expression to silence this warning
if (!iClient->connect(iServerAddress, iServerPort) > 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
( )
cc1plus: some warnings being treated as errors
The -Werror=logical-not-parentheses warning has been fixed in the latest master branch (here) as of commit https://github.com/arduino-libraries/ArduinoHttpClient/commit/9a5afdfc741a35ec18a71295c508c1142391ec09, but this fix has not yet been released.
@per1234 @aentinger - Could you please cut a new release for this library?
@per1234 Hi - what's the status on cutting a release from master as this is still impacting ESP32 BSP 2.0.5?
Hi @brentru. My role in this project is more on the triage end of things. I am not in a position to decide about making releases.
Perhaps one of the project's other maintainers will be able to answer your question.
Regards, Per
@per1234 Thank you for the clarification! Is @Rocketct the sole maintainer? If so, @Rocketct - could you please cut a new release?
I find this or a similar problem with 2.0.9. Has a version of the fix been implemented in a release?
For platformio users change the dependency to (current) latest commit:
- arduino-libraries/[email protected]
+ https://github.com/arduino-libraries/ArduinoHttpClient.git#6dc486747820d6544b41747c68c6b748f888d661
Done, see here.
Sorry, I haven't really gotten much to do with this library either, however from my general knowledge I consider it safe to release a new version.