Open DirkDev opened 9 years ago
Hi @DirkDev,
Seems like I ran into this error at one point before. Let me pull up my notes and see if I can locate the resolution.
Many thanks in advance
Dirk
On Mon, Aug 24, 2015 at 4:55 PM, Jason Gullickson notifications@github.com wrote:
Hi @DirkDev https://github.com/DirkDev,
Seems like I ran into this error at one point before. Let me pull up my notes and see if I can locate the resolution.
— Reply to this email directly or view it on GitHub https://github.com/jjg/RESTduino/issues/20#issuecomment-134233208.
Hi,
I have an EtherTen module and also had the same issue as above, is there any advice as to what needs to be done to get the code to compile?
BRJ.
Same issue here. Is there any resolution?
To re-produce:
Errors:
C:\Users\admin\Documents\Arduino\RESTduino\RESTduino.ino: In function 'void loop()':
C:\Users\admin\Documents\Arduino\RESTduino\RESTduino.ino:230:31: warning: NULL used in > > arithmetic [-Wpointer-arith]
else if(pin[0] != NULL) { ^
C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\utility\EthernetCompat.cpp: In function > 'void ethernet_compat_read_data(int, uint8t, uint8t, uint16_t)':
C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\utility\EthernetCompat.cpp:121:41: error: > invalid conversion from 'uint8_t* {aka unsigned char*}' to 'uint16_t {aka unsigned int}' [- fpermissive]
W5100.read_data(socket, src, dst, len);
^
In file included from C:\Program Files (x86)\Arduino\libraries\Ethernet\src/utility/socket.h:4:0,
from C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\utility\EthernetCompat.cpp:27:
C:\Program Files (x86)\Arduino\libraries\Ethernet\src/utility/w5100.h:142:8: error: initializing argument 2 of 'void W5100Class::read_data(SOCKET, uint16_t, volatile uint8_t*, uint16_t)' [-fpermissive]
void read_data(SOCKET s, volatile uint16_t src, volatile uint8_t * dst, uint16_t len);
^
exit status 1
Thanks for the feedback @carltstein. No resolution at the moment (I don't have a Windows machine to test this on).
Could it be a compatibility problem with the EthernetBonjour library on Windows? Do you know if any other sketches which use that library compile on your setup?
@jjg Got same Problem on Windows. Then i tested on MacOSX but still same problem. Seems to be an issue with your code not with the library itself.
It seems like a problem with the libraries because the signature of void W5100Class::read_data(SOCKET s, volatile uint8_t src, volatile uint8_t dst, uint16_t len) changed.
Tried many different libs but not getting it to work. Can you tell us which version of arduino you are using?
Found a working version by myself. It is Arduino 1.0.5.
Best Regards.
Here's the cause of the error: https://github.com/arduino-libraries/Ethernet/commit/abb5f02891bd90903e4721dcbb7dd0b9b062f859
Note that with recent versions of Arduino AVR Boards this has been downgraded from an error to a warning due to the addition of the -fpermissive
compiler flag:
https://github.com/arduino/ArduinoCore-avr/commit/06868f4cd39a9dba82b5014d1208feb1e1f0d750
This flag was added because the compiler update done at that time upgraded some things that had previously been warnings to errors without this flag but it also had the side effect of downgrading some things that had previously been errors to warnings. Other 3rd party boards support packages do not have -fpermissive
and even with Arduino AVR Boards this may be removed in the future:
This avoid build errors on old libraries. It may possibly be removed in the future after a period of transition.
Hi,
I have an UNO r3 with an ethernet shield. When compiling I get below error. To be honest, I have no idea how to start with this error. Hoping you can help me.
warning: NULL used in arithmetic [-Wpointer-arith]
Many thanks in advance! Dirk
Arduino: 1.6.5 (Windows 7), Board: "Arduino Uno"
Build options changed, rebuilding all
Using library EthernetBonjour in folder: C:\Program Files (x86)\Arduino\libraries\EthernetBonjour (legacy)
Using library SPI in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI Using library Ethernet in folder: C:\Program Files (x86)\Arduino\libraries\Ethernet
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++ -c -g -Os -Wall -Wextra -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard -IC:\Program Files (x86)\Arduino\libraries\EthernetBonjour -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI -IC:\Program Files (x86)\Arduino\libraries\Ethernet\src C:\Users\dirk\AppData\Local\Temp\build1197526729768169677.tmp\RESTduino.cpp -o C:\Users\dirk\AppData\Local\Temp\build1197526729768169677.tmp\RESTduino.cpp.o
RESTduino.ino: In function 'void loop()': RESTduino.ino:229:31: warning: NULL used in arithmetic [-Wpointer-arith] C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++ -c -g -Os -Wall -Wextra -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard -IC:\Program Files (x86)\Arduino\libraries\EthernetBonjour -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI -IC:\Program Files (x86)\Arduino\libraries\Ethernet\src -IC:\Program Files (x86)\Arduino\libraries\EthernetBonjour\utility C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\EthernetBonjour.cpp -o C:\Users\dirk\AppData\Local\Temp\build1197526729768169677.tmp\EthernetBonjour\EthernetBonjour.cpp.o
C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\EthernetBonjour.cpp: In member function 'int EthernetBonjourClass::_startMDNSSession()': C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\EthernetBonjour.cpp:291:94: warning: comparison is always false due to limited range of data type [-Wtype-limits] if (ethernet_compat_socket(this->_socket, ECSnMrUDP, MDNS_SERVER_PORT, ECSnMrMulticast) < 0) ^ C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\EthernetBonjour.cpp: In member function 'int EthernetBonjourClass::_closeMDNSSession()': C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\EthernetBonjour.cpp:306:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\EthernetBonjour.cpp: In member function 'MDNSError_t EthernetBonjourClass::_sendMDNSMessage(uint32_t, uint32_t, int, int)': C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\EthernetBonjour.cpp:527:1: warning: label 'errorReturn' defined but not used [-Wunused-label] errorReturn: ^ C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\EthernetBonjour.cpp: At global scope: C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\EthernetBonjour.cpp:311:13: warning: unused parameter 'peerAddress' [-Wunused-parameter] MDNSError_t EthernetBonjourClass::_sendMDNSMessage(uint32_t peerAddress, uint32_t xid, int type, ^ C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\EthernetBonjour.cpp:311:13: warning: unused parameter 'serviceRecord' [-Wunused-parameter] C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\EthernetBonjour.cpp: In member function 'MDNSError_t EthernetBonjourClass::_processMDNSQuery()': C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\EthernetBonjour.cpp:602:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (i=0; i<qCnt; i++) {
^ C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\EthernetBonjour.cpp:656:48: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] ir = (tr > sizeof(DNSHeader_t)) ? sizeof(DNSHeader_t) : tr; ^ C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\EthernetBonjour.cpp:552:44: warning: variable 'aCnt' set but not used [-Wunused-but-set-variable] uint16_t peer_port, udp_len, ptr, qCnt, aCnt, aaCnt, addCnt; ^ C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\EthernetBonjour.cpp:552:50: warning: variable 'aaCnt' set but not used [-Wunused-but-set-variable] uint16_t peer_port, udp_len, ptr, qCnt, aCnt, aaCnt, addCnt; ^ C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\EthernetBonjour.cpp:552:57: warning: variable 'addCnt' set but not used [-Wunused-but-set-variable] uint16_t peer_port, udp_len, ptr, qCnt, aCnt, aaCnt, addCnt; ^ C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\EthernetBonjour.cpp:1079:96: warning: 'peer_addr' may be used uninitialized in this function -Wmaybe-uninitializedthis->_sendMDNSMessage(peer_addr, xid, (int)MDNSPacketTypeServiceRecord, j-2); ^ C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\EthernetBonjour.cpp:1079:96: warning: 'xid' may be used uninitialized in this function [-Wmaybe-uninitialized] C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc -c -g -Os -Wall -Wextra -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard -IC:\Program Files (x86)\Arduino\libraries\EthernetBonjour -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI -IC:\Program Files (x86)\Arduino\libraries\Ethernet\src -IC:\Program Files (x86)\Arduino\libraries\EthernetBonjour\utility C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\utility\EthernetUtil.c -o C:\Users\dirk\AppData\Local\Temp\build1197526729768169677.tmp\EthernetBonjour\utility\EthernetUtil.c.o
C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\utility\EthernetUtil.c:64:0: warning: ignoring #pragma mark [-Wunknown-pragmas]
pragma mark -
^ C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\utility\EthernetUtil.c:65:0: warning: ignoring #pragma mark Private [-Wunknown-pragmas]
pragma mark Private
^ C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++ -c -g -Os -Wall -Wextra -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard -IC:\Program Files (x86)\Arduino\libraries\EthernetBonjour -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI -IC:\Program Files (x86)\Arduino\libraries\Ethernet\src -IC:\Program Files (x86)\Arduino\libraries\EthernetBonjour\utility C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\utility\EthernetCompat.cpp -o C:\Users\dirk\AppData\Local\Temp\build1197526729768169677.tmp\EthernetBonjour\utility\EthernetCompat.cpp.o
C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\utility\EthernetCompat.cpp: In function 'uint16_t ethernet_compat_write_private(uint16_t, uint8t, uint16_t)': C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\utility\EthernetCompat.cpp:54:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i=0; i<_len; i++) { ^ C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\utility\EthernetCompat.cpp: At global scope: C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\utility\EthernetCompat.cpp:66:6: warning: unused parameter 'rxtx_bufsize' [-Wunused-parameter] void ethernet_compat_init(uint8t macAddr, uint8_t* ipAddr, uint16_t rxtx_bufsize) ^ C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\utility\EthernetCompat.cpp: In function 'void ethernet_compat_read_data(int, uint8t, uint8t, uint16_t)': C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\utility\EthernetCompat.cpp:121:41: error: invalid conversion from 'uint8t* {aka unsigned char}' to 'uint16_t {aka unsigned int}' [-fpermissive] W5100.read_data(socket, src, dst, len); ^ In file included from C:\Program Files (x86)\Arduino\libraries\Ethernet\src/utility/socket.h:4:0, from C:\Program Files (x86)\Arduino\libraries\EthernetBonjour\utility\EthernetCompat.cpp:27: C:\Program Files (x86)\Arduino\libraries\Ethernet\src/utility/w5100.h:148:8: error: initializing argument 2 of 'void W5100Class::read_data(SOCKET, uint16_t, volatile uint8t, uint16_t)' [-fpermissive] void read_data(SOCKET s, volatile uint16_t src, volatile uint8_t * dst, uint16_t len); ^ Error compiling.