Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

overflow errors on build under 64bit musl, possibly others #48

Open
lilmike opened this issue Apr 27, 2021 · 2 comments
Open

overflow errors on build under 64bit musl, possibly others #48

lilmike opened this issue Apr 27, 2021 · 2 comments

Comments

@lilmike
Copy link

lilmike commented Apr 27, 2021

I'm trying to add qjoypad as a package under void linux, which builds for x86 and multiple arm archetectures, and when building on aarch64 I get the following errors:

[30/52] Building CXX object src/CMakeFiles/qjoypad.dir/joypad.cpp.o
FAILED: src/CMakeFiles/qjoypad.dir/joypad.cpp.o
/builddir/.xbps-qjoypad/wrappers/aarch64-linux-musl-c++ -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_X11EXTRAS_LIB -Isrc -I /usr/aarch64-linux-musl/usr/include/qt5 -I /usr/aarch64-linux-musl/usr/include/qt5/QtWidgets -I /usr/aarch64-linux-musl/usr/include/qt5/QtGui -I /usr/aarch64-linux-musl/usr/include/qt5/QtCore -I /usr/aarch64-linux-musl/usr/../usr/lib/qt5/mkspecs/linux-g++ -I /usr/aarch64-linux-musl/usr/include/qt5/QtX11Extras -fstack-clash-protection -D_FORTIFY_SOURCE=2 -O2 -march=armv8-a -I/usr/aarch64-linux-musl/usr/include -Wall -Wextra -Werror -pedantic -Wno-variadic-macros -fPIC -MD -MT src/CMakeFiles/qjoypad.dir/joypad.cpp.o -MF src/CMakeFiles/qjoypad.dir/joypad.cpp.o.d -o src/CMakeFiles/qjoypad.dir/joypad.cpp.o -c ../src/joypad.cpp
../src/joypad.cpp: In member function 'void JoyPad::open(int)':
../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) {
| ^~~~~~~~~~
../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);
| ^~~~~~~~~~
../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

Any ideas?
-Michael.

@lilmike lilmike changed the title overflow errors on build under aarch64, possibly others overflow errors on build under 64bit musl, possibly others Apr 27, 2021
@lilmike
Copy link
Author

lilmike commented Apr 27, 2021

Actually it looks like it might be failing under 64 bit musl. Still looking for feedback and a possible fix :-).
-Michael.

@panzi
Copy link
Owner

panzi commented Apr 29, 2021

I don't see anything wrong at the referenced lines and I don't get any compile errors (using glibc). But you could try to remove -Werror from CMakeLists.txt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants