Consistant Error message on Ethernet

i am always getting the following error message, on any Arduino sketch i try and compile. this specific message is on a Mega 2560 R3. why am i always seeing this > my original code is attached

In file included from /snap/arduino/50/libraries/Ethernet/src/Dns.cpp:8:0:
/snap/arduino/50/libraries/Ethernet/src/Dns.cpp: In member function 'uint16_t DNSClient::BuildRequest(const char*)':
/snap/arduino/50/libraries/Ethernet/src/utility/w5100.h:457:25: warning: result of '(256 << 8)' requires 18 bits to represent, but 'int' only has 16 bits [-Wshift-overflow=]
#define htons(x) ( (((x)<<8)&0xFF00) | (((x)>>8)&0xFF) )

/snap/arduino/50/libraries/Ethernet/src/Dns.cpp:164:18: note: in expansion of macro 'htons'
twoByteBuffer = htons(QUERY_FLAG | OPCODE_STANDARD_QUERY | RECURSION_DESIRED_FLAG);

[BareMinEth.ino|attachment](upload://eIURQZImoBTLRNBmqLionHXK3Sm.ino) (776 Bytes)

This previous post asks the same question -- does it shed any light?

https://forum.arduino.cc/index.php?topic=647823.0

ok all i have figured out my problem , Do not use the Snap package version of Arduino, i have uninstalled the snap version and downloaded from the Arduino Site and everything is working fine. same code no compile errors.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.