community/seatd: fails to build on ppc64le – ioctl type on musl
ninja: job failed: gcc -Iseatd.p -I. -I.. -I../include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -std=c11 -Wundef -Wunused -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Wstrict-prototypes -Wimplicit-fallthrough -Wmissing-prototypes -Wvla -Wl,--exclude-libs=ALL -D_XOPEN_SOURCE=700 -D__BSD_VISIBLE '-DSEATD_VERSION="0.6.3"' '-DSEATD_DEFAULTPATH="/run/seatd.sock"' '-DSEATD_INSTALLPATH="/usr/bin/seatd"' '-DREL_SRC_DIR="../"' -DSEATD_ENABLED=1 -DLOGIND_ENABLED=1 -DHAVE_ELOGIND=1 -Os -fomit-frame-pointer -Os -fomit-frame-pointer -fPIE -MD -MQ seatd.p/common_evdev.c.o -MF seatd.p/common_evdev.c.o.d -o seatd.p/common_evdev.c.o -c ../common/evdev.c ../common/evdev.c: In function 'evdev_revoke': ../common/evdev.c:27:19: error: overflow in conversion from 'long unsigned int' to 'int' changes value from '2147763601' to '-2147203695' [-Werror=overflow] 27 | return ioctl(fd, EVIOCREVOKE, NULL); | ^~~~~~~~~~~ cc1: all warnings being treated as errors
Reported to upstream: https://todo.sr.ht/~kennylevinsen/seatd/10
Response from the author:
Hmm, seems to be a musl vs. the world thing. POSIX defines the ioctl request type as signed int, while glibc on Linux and various BSD libc's defines it as unsigned long. The ioctl request constants overflow a signed int, leading to this warning when using musl. I'm all for POSIX, but if all relevant OS's are incompatible I find it a little silly. See #7580, which links to the musl mailing list.
Other than trying to add bogus casts, I'm not sure there's much I can do about that. I assume it works fine when you disable Werror?
@kaniini, can you help plz?