arduino-libraries / Ethernet

Ethernet Library for Arduino
http://arduino.cc/
261 stars 264 forks source link

Fix compiler warning in `htons()` #161

Closed gudnimg closed 3 years ago

gudnimg commented 3 years ago

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 commented 3 years ago

CLA assistant check
All committers have signed the CLA.

github-actions[bot] commented 3 years ago

Memory usage change @ 68ac2aed3c5db856020dbcb15e39dc803f674ff6

Board flash % RAM for global variables %
arduino:avr:leonardo :green_heart: -134 - 0 -0.47 - 0.0 0 - 0 0.0 - 0.0
arduino:avr:mega :green_heart: -134 - 0 -0.05 - 0.0 0 - 0 0.0 - 0.0
arduino:avr:nano :green_heart: -134 - 0 -0.44 - 0.0 0 - 0 0.0 - 0.0
arduino:megaavr:nona4809 :green_heart: -132 - 0 -0.27 - 0.0 0 - 0 0.0 - 0.0
arduino:megaavr:uno2018 :green_heart: -132 - 0 -0.27 - 0.0 0 - 0 0.0 - 0.0
arduino:sam:arduino_due_x_dbg :green_heart: -88 - 0 -0.02 - 0.0 N/A N/A
arduino:samd:arduino_zero_edbg :green_heart: -64 - 0 -0.02 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkr1000 :green_heart: -64 - 0 -0.02 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrfox1200 :green_heart: -64 - 0 -0.02 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 :green_heart: -64 - 0 -0.02 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 :green_heart: -64 - 0 -0.02 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrvidor4000 :green_heart: -64 - 0 -0.02 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 :green_heart: -64 - 0 -0.02 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1310 :green_heart: -64 - 0 -0.02 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 :green_heart: -64 - 0 -0.02 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrzero :green_heart: -64 - 0 -0.02 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot :green_heart: -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
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 ```
gudnimg commented 3 years ago

@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 commented 3 years ago

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 commented 3 years ago

@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.

github-actions[bot] commented 3 years ago

Memory usage change @ 550940306c2d1ead18eb7f788224592acd1c4f12

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/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duino: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
Click for full report CSV ``` 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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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 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 commented 3 years ago

any updates on this?

ghost commented 3 years ago

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 commented 3 years ago

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.