Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-DNO_GLOBAL_INSTANCES breaks ESP8266HttpClient #8183

Closed
6 tasks done
paulocsanz opened this issue Jun 27, 2021 · 2 comments · Fixed by #8184
Closed
6 tasks done

-DNO_GLOBAL_INSTANCES breaks ESP8266HttpClient #8183

paulocsanz opened this issue Jun 27, 2021 · 2 comments · Fixed by #8184

Comments

@paulocsanz
Copy link
Contributor

paulocsanz commented Jun 27, 2021

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: ESP-12
  • Core Version: master
  • Development Env: Platformio
  • Operating System: Ubuntu

Problem Description

Defining NO_GLOBAL_INSTANCES breaks ESP8266HttpClient because it depends on devnull being defined. But it seems that if it's needed, it shouldn't be disable by that option. And since it's one byte it seems acceptable.

/src/ESP8266HTTPClient.cpp:850:32: error: 'devnull' was not declared in this scope
  850 |         _client->sendAvailable(devnull); // clear _client's output (all of it, no timeout)
      |                                ^~~~~~~
*** [.pio/build/release/libc18/ESP8266HTTPClient/ESP8266HTTPClient.cpp.o] Error 1
@paulocsanz
Copy link
Contributor Author

Serial is always declared as external in the header, but not defined when NO_GLOBAL_INSTANCES is defined. But other globals aren't even declared in the headers if NO_GLOBAL_INSTANCES is defined.

Should it also not be defined in that case?

@dok-net
Copy link
Contributor

dok-net commented Jul 4, 2021

@paulocsanz Both Serial and Serial1, to be precise. Now while you are at it, there shouldn't be a problem enclosing that in #ifdef, given that your results indicate it passes the linker phase just fine. From my POV, go ahead and add the #ifdef to your PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants