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

Fix compiler warning in htons() #161

Merged
merged 1 commit into from
Jul 22, 2021
Merged

Conversation

gudnimg
Copy link
Contributor

@gudnimg gudnimg commented Apr 19, 2021

Fixes #151
Fixes #122

The macros are completely redundant. Using for example htons() on a uint16_t just wastes cycles if the compiler doesn't optimise it out. htons() converts a variable to 16 bits (which does nothing for a 16 bit variable). Same goes for htonl() for 32-bit variables.

Building these changes in a project of mine shows the memory footprint is reduced by 32 bytes. This will also fix two issues related to overflow compiler warnings with htons().

Edit: This PR will only fix the compiler warning in the linked issues.

@CLAassistant
Copy link

CLAassistant commented Apr 19, 2021

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link

Memory usage change @ 68ac2ae

Board flash % RAM for global variables %
arduino:avr:leonardo 💚 -134 - 0 -0.47 - 0.0 0 - 0 0.0 - 0.0
arduino:avr:mega 💚 -134 - 0 -0.05 - 0.0 0 - 0 0.0 - 0.0
arduino:avr:nano 💚 -134 - 0 -0.44 - 0.0 0 - 0 0.0 - 0.0
arduino:megaavr:nona4809 💚 -132 - 0 -0.27 - 0.0 0 - 0 0.0 - 0.0
arduino:megaavr:uno2018 💚 -132 - 0 -0.27 - 0.0 0 - 0 0.0 - 0.0
arduino:sam:arduino_due_x_dbg 💚 -88 - 0 -0.02 - 0.0 N/A N/A
arduino:samd:arduino_zero_edbg 💚 -64 - 0 -0.02 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkr1000 💚 -64 - 0 -0.02 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrfox1200 💚 -64 - 0 -0.02 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 💚 -64 - 0 -0.02 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 💚 -64 - 0 -0.02 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrvidor4000 💚 -64 - 0 -0.02 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 💚 -64 - 0 -0.02 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1310 💚 -64 - 0 -0.02 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 💚 -64 - 0 -0.02 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrzero 💚 -64 - 0 -0.02 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot 💚 -64 - 0 -0.02 - 0.0 0 - 0 0.0 - 0.0
Click for full report table
Board examples/AdvancedChatServer
flash
% examples/AdvancedChatServer
RAM for global variables
% examples/BarometricPressureWebServer
flash
% examples/BarometricPressureWebServer
RAM for global variables
% examples/ChatServer
flash
% examples/ChatServer
RAM for global variables
% examples/DhcpAddressPrinter
flash
% examples/DhcpAddressPrinter
RAM for global variables
% examples/DhcpChatServer
flash
% examples/DhcpChatServer
RAM for global variables
% examples/LinkStatus
flash
% examples/LinkStatus
RAM for global variables
% examples/TelnetClient
flash
% examples/TelnetClient
RAM for global variables
% examples/UDPSendReceiveString
flash
% examples/UDPSendReceiveString
RAM for global variables
% examples/UdpNtpClient
flash
% examples/UdpNtpClient
RAM for global variables
% examples/WebClient
flash
% examples/WebClient
RAM for global variables
% examples/WebClientRepeating
flash
% examples/WebClientRepeating
RAM for global variables
% examples/WebServer
flash
% examples/WebServer
RAM for global variables
%
arduino:avr:leonardo -32 -0.11 0 0.0 -32 -0.11 0 0.0 -32 -0.11 0 0.0 -134 -0.47 0 0.0 -134 -0.47 0 0.0 0 0.0 0 0.0 -32 -0.11 0 0.0 -32 -0.11 0 0.0 -134 -0.47 0 0.0 -134 -0.47 0 0.0 -134 -0.47 0 0.0 -32 -0.11 0 0.0
arduino:avr:mega -32 -0.01 0 0.0 -32 -0.01 0 0.0 -32 -0.01 0 0.0 -134 -0.05 0 0.0 -134 -0.05 0 0.0 0 0.0 0 0.0 -32 -0.01 0 0.0 -32 -0.01 0 0.0 -134 -0.05 0 0.0 -134 -0.05 0 0.0 -134 -0.05 0 0.0 -32 -0.01 0 0.0
arduino:avr:nano -32 -0.1 0 0.0 -32 -0.1 0 0.0 -32 -0.1 0 0.0 -134 -0.44 0 0.0 -134 -0.44 0 0.0 0 0.0 0 0.0 -32 -0.1 0 0.0 -32 -0.1 0 0.0 -134 -0.44 0 0.0 -134 -0.44 0 0.0 -134 -0.44 0 0.0 -32 -0.1 0 0.0
arduino:megaavr:nona4809 -32 -0.07 0 0.0 -32 -0.07 0 0.0 -32 -0.07 0 0.0 -132 -0.27 0 0.0 -132 -0.27 0 0.0 0 0.0 0 0.0 -32 -0.07 0 0.0 -32 -0.07 0 0.0 -132 -0.27 0 0.0 -132 -0.27 0 0.0 -132 -0.27 0 0.0 -32 -0.07 0 0.0
arduino:megaavr:uno2018 -32 -0.07 0 0.0 -32 -0.07 0 0.0 -32 -0.07 0 0.0 -132 -0.27 0 0.0 -132 -0.27 0 0.0 0 0.0 0 0.0 -32 -0.07 0 0.0 -32 -0.07 0 0.0 -132 -0.27 0 0.0 -132 -0.27 0 0.0 -132 -0.27 0 0.0 -32 -0.07 0 0.0
arduino:sam:arduino_due_x_dbg -56 -0.01 N/A N/A -56 -0.01 N/A N/A -56 -0.01 N/A N/A -88 -0.02 N/A N/A -80 -0.02 N/A N/A 0 0.0 N/A N/A -56 -0.01 N/A N/A -56 -0.01 N/A N/A -80 -0.02 N/A N/A -88 -0.02 N/A N/A -88 -0.02 N/A N/A -56 -0.01 N/A N/A
arduino:samd:arduino_zero_edbg -36 -0.01 0 0.0 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 0 0.0 0 0.0 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 -36 -0.01 0 0.0
arduino:samd:mkr1000 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 0 0.0 0 0.0 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 -36 -0.01 0 0.0
arduino:samd:mkrfox1200 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 0 0.0 0 0.0 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 -36 -0.01 0 0.0
arduino:samd:mkrgsm1400 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 0 0.0 0 0.0 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 -36 -0.01 0 0.0
arduino:samd:mkrnb1500 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 0 0.0 0 0.0 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 -36 -0.01 0 0.0
arduino:samd:mkrvidor4000 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 0 0.0 0 0.0 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 -36 -0.01 0 0.0
arduino:samd:mkrwan1300 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 0 0.0 0 0.0 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 -36 -0.01 0 0.0
arduino:samd:mkrwan1310 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 0 0.0 0 0.0 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 -36 -0.01 0 0.0
arduino:samd:mkrwifi1010 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 0 0.0 0 0.0 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 -36 -0.01 0 0.0
arduino:samd:mkrzero -36 -0.01 0 0.0 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 0 0.0 0 0.0 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 -36 -0.01 0 0.0
arduino:samd:nano_33_iot -36 -0.01 0 0.0 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 0 0.0 0 0.0 -36 -0.01 0 0.0 -36 -0.01 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 -64 -0.02 0 0.0 -36 -0.01 0 0.0
Click for full report CSV
Board,examples/AdvancedChatServer<br>flash,%,examples/AdvancedChatServer<br>RAM for global variables,%,examples/BarometricPressureWebServer<br>flash,%,examples/BarometricPressureWebServer<br>RAM for global variables,%,examples/ChatServer<br>flash,%,examples/ChatServer<br>RAM for global variables,%,examples/DhcpAddressPrinter<br>flash,%,examples/DhcpAddressPrinter<br>RAM for global variables,%,examples/DhcpChatServer<br>flash,%,examples/DhcpChatServer<br>RAM for global variables,%,examples/LinkStatus<br>flash,%,examples/LinkStatus<br>RAM for global variables,%,examples/TelnetClient<br>flash,%,examples/TelnetClient<br>RAM for global variables,%,examples/UDPSendReceiveString<br>flash,%,examples/UDPSendReceiveString<br>RAM for global variables,%,examples/UdpNtpClient<br>flash,%,examples/UdpNtpClient<br>RAM for global variables,%,examples/WebClient<br>flash,%,examples/WebClient<br>RAM for global variables,%,examples/WebClientRepeating<br>flash,%,examples/WebClientRepeating<br>RAM for global variables,%,examples/WebServer<br>flash,%,examples/WebServer<br>RAM for global variables,%
arduino:avr:leonardo,-32,-0.11,0,0.0,-32,-0.11,0,0.0,-32,-0.11,0,0.0,-134,-0.47,0,0.0,-134,-0.47,0,0.0,0,0.0,0,0.0,-32,-0.11,0,0.0,-32,-0.11,0,0.0,-134,-0.47,0,0.0,-134,-0.47,0,0.0,-134,-0.47,0,0.0,-32,-0.11,0,0.0
arduino:avr:mega,-32,-0.01,0,0.0,-32,-0.01,0,0.0,-32,-0.01,0,0.0,-134,-0.05,0,0.0,-134,-0.05,0,0.0,0,0.0,0,0.0,-32,-0.01,0,0.0,-32,-0.01,0,0.0,-134,-0.05,0,0.0,-134,-0.05,0,0.0,-134,-0.05,0,0.0,-32,-0.01,0,0.0
arduino:avr:nano,-32,-0.1,0,0.0,-32,-0.1,0,0.0,-32,-0.1,0,0.0,-134,-0.44,0,0.0,-134,-0.44,0,0.0,0,0.0,0,0.0,-32,-0.1,0,0.0,-32,-0.1,0,0.0,-134,-0.44,0,0.0,-134,-0.44,0,0.0,-134,-0.44,0,0.0,-32,-0.1,0,0.0
arduino:megaavr:nona4809,-32,-0.07,0,0.0,-32,-0.07,0,0.0,-32,-0.07,0,0.0,-132,-0.27,0,0.0,-132,-0.27,0,0.0,0,0.0,0,0.0,-32,-0.07,0,0.0,-32,-0.07,0,0.0,-132,-0.27,0,0.0,-132,-0.27,0,0.0,-132,-0.27,0,0.0,-32,-0.07,0,0.0
arduino:megaavr:uno2018,-32,-0.07,0,0.0,-32,-0.07,0,0.0,-32,-0.07,0,0.0,-132,-0.27,0,0.0,-132,-0.27,0,0.0,0,0.0,0,0.0,-32,-0.07,0,0.0,-32,-0.07,0,0.0,-132,-0.27,0,0.0,-132,-0.27,0,0.0,-132,-0.27,0,0.0,-32,-0.07,0,0.0
arduino:sam:arduino_due_x_dbg,-56,-0.01,N/A,N/A,-56,-0.01,N/A,N/A,-56,-0.01,N/A,N/A,-88,-0.02,N/A,N/A,-80,-0.02,N/A,N/A,0,0.0,N/A,N/A,-56,-0.01,N/A,N/A,-56,-0.01,N/A,N/A,-80,-0.02,N/A,N/A,-88,-0.02,N/A,N/A,-88,-0.02,N/A,N/A,-56,-0.01,N/A,N/A
arduino:samd:arduino_zero_edbg,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,0,0.0,0,0.0,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,-36,-0.01,0,0.0
arduino:samd:mkr1000,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,0,0.0,0,0.0,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,-36,-0.01,0,0.0
arduino:samd:mkrfox1200,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,0,0.0,0,0.0,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,-36,-0.01,0,0.0
arduino:samd:mkrgsm1400,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,0,0.0,0,0.0,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,-36,-0.01,0,0.0
arduino:samd:mkrnb1500,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,0,0.0,0,0.0,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,-36,-0.01,0,0.0
arduino:samd:mkrvidor4000,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,0,0.0,0,0.0,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,-36,-0.01,0,0.0
arduino:samd:mkrwan1300,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,0,0.0,0,0.0,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,-36,-0.01,0,0.0
arduino:samd:mkrwan1310,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,0,0.0,0,0.0,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,-36,-0.01,0,0.0
arduino:samd:mkrwifi1010,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,0,0.0,0,0.0,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,-36,-0.01,0,0.0
arduino:samd:mkrzero,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,0,0.0,0,0.0,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,-36,-0.01,0,0.0
arduino:samd:nano_33_iot,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,0,0.0,0,0.0,-36,-0.01,0,0.0,-36,-0.01,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,-64,-0.02,0,0.0,-36,-0.01,0,0.0

@gudnimg gudnimg changed the title Remove redundant macros htons() and htonl(). Save 32 bytes of memory Remove redundant macros htons() and htonl(). Save at least 32 bytes of memory Apr 19, 2021
@gudnimg
Copy link
Contributor Author

gudnimg commented Apr 20, 2021

@aentinger @cmaglie @per1234 I see from the commit history you were the last to commit to this repo. Would a review be possible? I'm not sure who to ask.

@JAndrassy
Copy link
Contributor

and you say you tested DNS and DHCP with this? because it can't work with the numbers in host order of Arduinos. the macros swap the endianness between host and network order.

#include <Ethernet.h>

void setup() {
  Serial.begin(115200);

  uint32_t n32 = 0x01020304;
  Serial.print("0x0");
  Serial.println(n32, HEX);

  n32 = htonl(n32);
  Serial.print("0x0");
  Serial.println(n32, HEX);

  uint16_t n16 = 0x0102;
  Serial.print("0x0");
  Serial.println(n16, HEX);
  n16 = htons(n16);
  Serial.print("0x0");
  Serial.println(n16, HEX);
}

void loop() {

}

output

0x01020304
0x04030201
0x0102
0x0201

@gudnimg
Copy link
Contributor Author

gudnimg commented Apr 20, 2021

@JAndrassy Very good point. Thank you. I think it's best for me to focus on fixing the compiler warning 😅 . I reverted most of the changes but added comments above the macros.

@gudnimg gudnimg changed the title Remove redundant macros htons() and htonl(). Save at least 32 bytes of memory Fix compiler warning in htons() Apr 20, 2021
@github-actions
Copy link

Memory usage change @ 5509403

Board flash % RAM for global variables %
arduino:avr:leonardo 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:avr:mega 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:avr:nano 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:megaavr:nona4809 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:megaavr:uno2018 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:sam:arduino_due_x_dbg 0 - 0 0.0 - 0.0 N/A N/A
arduino:samd:arduino_zero_edbg 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkr1000 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrfox1200 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrvidor4000 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1310 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrzero 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table
Board examples/AdvancedChatServer
flash
% examples/AdvancedChatServer
RAM for global variables
% examples/BarometricPressureWebServer
flash
% examples/BarometricPressureWebServer
RAM for global variables
% examples/ChatServer
flash
% examples/ChatServer
RAM for global variables
% examples/DhcpAddressPrinter
flash
% examples/DhcpAddressPrinter
RAM for global variables
% examples/DhcpChatServer
flash
% examples/DhcpChatServer
RAM for global variables
% examples/LinkStatus
flash
% examples/LinkStatus
RAM for global variables
% examples/TelnetClient
flash
% examples/TelnetClient
RAM for global variables
% examples/UDPSendReceiveString
flash
% examples/UDPSendReceiveString
RAM for global variables
% examples/UdpNtpClient
flash
% examples/UdpNtpClient
RAM for global variables
% examples/WebClient
flash
% examples/WebClient
RAM for global variables
% examples/WebClientRepeating
flash
% examples/WebClientRepeating
RAM for global variables
% examples/WebServer
flash
% examples/WebServer
RAM for global variables
%
arduino:avr:leonardo 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:avr:mega 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:avr:nano 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:megaavr:nona4809 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:megaavr:uno2018 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:sam:arduino_due_x_dbg 0 0.0 N/A N/A 0 0.0 N/A N/A 0 0.0 N/A N/A 0 0.0 N/A N/A 0 0.0 N/A N/A 0 0.0 N/A N/A 0 0.0 N/A N/A 0 0.0 N/A N/A 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0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrwan1310 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrwifi1010 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrzero 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:nano_33_iot 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
Click for full report CSV
Board,examples/AdvancedChatServer<br>flash,%,examples/AdvancedChatServer<br>RAM for global variables,%,examples/BarometricPressureWebServer<br>flash,%,examples/BarometricPressureWebServer<br>RAM for global variables,%,examples/ChatServer<br>flash,%,examples/ChatServer<br>RAM for global variables,%,examples/DhcpAddressPrinter<br>flash,%,examples/DhcpAddressPrinter<br>RAM for global variables,%,examples/DhcpChatServer<br>flash,%,examples/DhcpChatServer<br>RAM for global variables,%,examples/LinkStatus<br>flash,%,examples/LinkStatus<br>RAM for global variables,%,examples/TelnetClient<br>flash,%,examples/TelnetClient<br>RAM for global variables,%,examples/UDPSendReceiveString<br>flash,%,examples/UDPSendReceiveString<br>RAM for global variables,%,examples/UdpNtpClient<br>flash,%,examples/UdpNtpClient<br>RAM for global variables,%,examples/WebClient<br>flash,%,examples/WebClient<br>RAM for global variables,%,examples/WebClientRepeating<br>flash,%,examples/WebClientRepeating<br>RAM for global variables,%,examples/WebServer<br>flash,%,examples/WebServer<br>RAM for global variables,%
arduino:avr:leonardo,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:avr:mega,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:avr:nano,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:megaavr:nona4809,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:megaavr:uno2018,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0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4000,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrwan1300,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrwan1310,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrwifi1010,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrzero,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:nano_33_iot,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0

@ghost
Copy link

ghost commented Jul 19, 2021

any updates on this?

Copy link
Contributor

@aentinger aentinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@aentinger aentinger merged commit 7c32bbe into arduino-libraries:master Jul 22, 2021
@ghost
Copy link

ghost commented Jul 22, 2021

and you say you tested DNS and DHCP with this? because it can't work with the numbers in host order of Arduinos. the macros swap the endianness between host and network order.

Btw is this still an issue in the merged changes?

@JAndrassy
Copy link
Contributor

and you say you tested DNS and DHCP with this? because it can't work with the numbers in host order of Arduinos. the macros swap the endianness between host and network order.

Btw is this still an issue in the merged changes?

it is not. @gudnimg removed from this PR all problematic changes except of a super simple change to avoid the warning.

@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overflow warning in htons() Ethernet library compile warning
5 participants