We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
As the title says. Reproducer sketch:
#include <Ethernet.h> // -------------------------------------------------------------------------------- // remove_reference template<typename T> struct remove_reference { typedef T type; }; template<typename T> struct remove_reference<T &> { typedef T type; }; template<typename T> struct remove_reference<T &&> { typedef T type; }; #define MOVE(...) \ static_cast<typename remove_reference<decltype(__VA_ARGS__)>::type &&>( \ __VA_ARGS__) void setup() { EthernetClient ec = {}; EthernetClient ec2{ MOVE(ec) }; // Crashes the board } void loop() {}
The text was updated successfully, but these errors were encountered:
It seems like it's not exclusive to moving. Copying also has the same effect:
void setup() { EthernetClient ec = {}; EthernetClient ec2{ ec }; // Crashes the board }
Sorry, something went wrong.
I have the same issue with verion 4.0.8.
I believe this bug makes it impossible to use the Ethernet server accepting Ethernet client connections using the standard implementation:
client = server.available(); if (client) { ...
which tries to return an EthernetClient object from the available() call which is internally created using a copy constructor.
EthernetClient
available()
I tracked it down to arduino::MbedClient::setSocket() trying to configure a nullptr socket with this possible fix:
arduino::MbedClient::setSocket()
void arduino::MbedClient::setSocket(Socket *_sock) { sock = _sock; if (sock != nullptr) // Configure only if not null configureSocket(sock); }
No branches or pull requests
As the title says. Reproducer sketch:
The text was updated successfully, but these errors were encountered: