xkonni / raspberry-remote

Control remote plugs with the Raspberry Pi, features a webinterface. Uses RCSwitch and wiringPi.
GNU General Public License v2.0
109 stars 47 forks source link

Doesn't compile #31

Closed beedaddy closed 4 years ago

beedaddy commented 6 years ago

On a RPi3 with a recent Arch Linux ARM running, this doesn't compile (GCC 8.2.0). I get lots of these errors:

RCSwitch.cpp: In member function 'char* RCSwitch::getCodeWordB(int, int, boolean)':
RCSwitch.cpp:218:12: error: invalid conversion from 'char' to 'char*' [-fpermissive]
     return '\0';
            ^~~~
kimdiallo commented 5 years ago

Can confirm, same error on debian buster arm64v8


RCSwitch.cpp:388:12: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive]
     return '\0';
            ^~~~
RCSwitch.cpp: In member function ‘void RCSwitch::enableReceive()’:
RCSwitch.cpp:569:32: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
     RCSwitch::nReceivedValue = NULL;
                                ^~~~
RCSwitch.cpp:570:36: warning: converting to non-pointer type ‘unsigned int’ from NULL [-Wconversion-null]
     RCSwitch::nReceivedBitlength = NULL;
                                    ^~~~
RCSwitch.cpp: In member function ‘bool RCSwitch::available()’:
RCSwitch.cpp:582:38: warning: NULL used in arithmetic [-Wpointer-arith]
   return RCSwitch::nReceivedValue != NULL;
                                      ^~~~
RCSwitch.cpp: In member function ‘void RCSwitch::resetAvailable()’:
RCSwitch.cpp:586:30: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
   RCSwitch::nReceivedValue = NULL;
                              ^~~~
make: *** [<builtin>: RCSwitch.o] Error 1```
tynie commented 5 years ago

Same error:

RCSwitch.cpp: In constructor ‘RCSwitch::RCSwitch()’:
RCSwitch.cpp:41:30: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null]
   RCSwitch::nReceivedValue = NULL;
                              ^~~~
RCSwitch.cpp: In member function ‘char* RCSwitch::getCodeWordB(int, int, boolean)’:
RCSwitch.cpp:218:12: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive]
     return '\0';
            ^~~~
RCSwitch.cpp: In member function ‘char* RCSwitch::getCodeWordA(char*, int, boolean)’:
RCSwitch.cpp:261:14: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive]
       return '\0';
              ^~~~
RCSwitch.cpp:270:14: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive]
       return '\0';
              ^~~~
RCSwitch.cpp: In member function ‘char* RCSwitch::getCodeWordD(char*, int, boolean)’:
RCSwitch.cpp:335:14: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive]
       return '\0';
              ^~~~
RCSwitch.cpp:344:14: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive]
       return '\0';
              ^~~~
RCSwitch.cpp: In member function ‘char* RCSwitch::getCodeWordC(char, int, int, boolean)’:
RCSwitch.cpp:388:12: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive]
     return '\0';
MotschaM commented 5 years ago

On Raspberry Pi 4 g++ -Wall -lwiringPi -c -o RCSwitch.o RCSwitch.cpp RCSwitch.cpp:31:42: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null] unsigned long RCSwitch::nReceivedValue = NULL; ^~~~ RCSwitch.cpp: In constructor ‘RCSwitch::RCSwitch()’: RCSwitch.cpp:41:30: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null] RCSwitch::nReceivedValue = NULL; ^~~~ RCSwitch.cpp: In member function ‘char* RCSwitch::getCodeWordB(int, int, boolean)’: RCSwitch.cpp:218:12: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive] return '\0'; ^~~~ RCSwitch.cpp: In member function ‘char* RCSwitch::getCodeWordA(char*, int, boolean)’: RCSwitch.cpp:261:14: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive] return '\0'; ^~~~ RCSwitch.cpp:270:14: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive] return '\0'; ^~~~ RCSwitch.cpp: In member function ‘char* RCSwitch::getCodeWordD(char*, int, boolean)’: RCSwitch.cpp:335:14: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive] return '\0'; ^~~~ RCSwitch.cpp:344:14: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive] return '\0'; ^~~~ RCSwitch.cpp: In member function ‘char* RCSwitch::getCodeWordC(char, int, int, boolean)’: RCSwitch.cpp:388:12: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive] return '\0'; ^~~~ RCSwitch.cpp: In member function ‘void RCSwitch::enableReceive()’: RCSwitch.cpp:569:32: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null] RCSwitch::nReceivedValue = NULL; ^~~~ RCSwitch.cpp:570:36: warning: converting to non-pointer type ‘unsigned int’ from NULL [-Wconversion-null] RCSwitch::nReceivedBitlength = NULL; ^~~~ RCSwitch.cpp: In member function ‘bool RCSwitch::available()’: RCSwitch.cpp:582:38: warning: NULL used in arithmetic [-Wpointer-arith] return RCSwitch::nReceivedValue != NULL; ^~~~ RCSwitch.cpp: In member function ‘void RCSwitch::resetAvailable()’: RCSwitch.cpp:586:30: warning: converting to non-pointer type ‘long unsigned int’ from NULL [-Wconversion-null] RCSwitch::nReceivedValue = NULL; ^~~~ make: *** [<builtin>: RCSwitch.o] Error 1

xkonni commented 5 years ago

not using this anymore for some years now. please try the dev branch where i blindly applied possible fixes.

theunreallpj commented 4 years ago

Does anyone got it now ? I've tried everything but nothing worked

xkonni commented 4 years ago

tried a quick & dirty fix in 13055a10c4fec89a21294f557fe24e93d052c3e7 - as I dont have the hardware anymore, I would kindly ask you to report back.