Open
Description
The header file has a line:
const IPAddress INADDR_NONE(0,0,0,0);
Which means every file that includes this header will be assigned its own INADDR_NONE. Projects with limited static memory will encounter problems when this file is included in many .cpp files.
A suggested workaround (which I have confirmed works) would be to make IPAddress.h say extern const IPAddress INADDR_NONE;
and define the actual variable in IPAddress.cpp as const IPAddress INADDR_NONE(0,0,0,0);
Metadata
Metadata
Assignees
Labels
No labels
Activity
per1234 commentedon Feb 22, 2022
Thanks for your suggestion @pianistrevor!
There was a previous report of this arduino/Arduino#1007
It was considered resolved by doing just what you suggested in the
arduino/ArduinoCore-API
repository:arduino/ArduinoCore-API@3dbd7d7
However, the "Arduino AVR Boards" core has not yet transitioned to using ArduinoCore-API(#329), so the issue persists in this core.
pianistrevor commentedon Feb 22, 2022
Good to know, thank you! Will this be something this core does in the future, or should I plan to configure a different board? I’m currently using a CI framework that installs AVR...
edit: I looked at the PR, if the owner doesn’t make the changes I would happily consider doing my own version of this with appropriate changes