panzi / qjoypad

fork of qjoypad http://qjoypad.sourceforge.net/
GNU General Public License v2.0
120 stars 25 forks source link

error: overflow in conversion from 'long unsigned int' to 'int' when compiling with musl #38

Open benalb opened 4 years ago

benalb commented 4 years ago

trying to compile with Void 5.6.11_1 x86_64-musl, get this:

/home/benalb/tmp/qjoypad/src/joypad.cpp: In member function 'void JoyPad::open(int)': /home/benalb/tmp/qjoypad/src/joypad.cpp:71:23: error: overflow in conversion from 'long unsigned int' to 'int' changes value from '2164288019' to '-2130679277' [-Werror=overflow] 71 | if (ioctl(joydev, JSIOCGNAME(sizeof(id)), id) < 0) { | ^~~~~~~~~~ /home/benalb/tmp/qjoypad/src/joypad.cpp:80:20: error: overflow in conversion from 'long unsigned int' to 'int' changes value from '2147576337' to '-2147390959' [-Werror=overflow] 80 | ioctl (joydev, JSIOCGAXES, &axisCount); | ^~~~~~~~~~ /home/benalb/tmp/qjoypad/src/joypad.cpp:82:20: error: overflow in conversion from 'long unsigned int' to 'int' changes value from '2147576338' to '-2147390958' [-Werror=overflow] 82 | ioctl (joydev, JSIOCGBUTTONS, &buttonCount); | ^~~~~~~~~~~~~ cc1plus: all warnings being treated as errors make[2]: *** [src/CMakeFiles/qjoypad.dir/build.make:264: src/CMakeFiles/qjoypad.dir/joypad.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:191: src/CMakeFiles/qjoypad.dir/all] Error 2 make: *** [Makefile:150: all] Error 2

I guess is related to this