I have -Wcast-align in my global build flags, and this leads to: * Package: dev-util/umockdev-0.16.1-r1 * Repository: gentoo * Maintainer: gnome@gentoo.org * USE: elibc_glibc kernel_linux sparc test userland_GNU * FEATURES: network-sandbox preserve-libs sandbox test userpriv usersandbox * Using python3.10 to build […] Vala compiler for the host machine: /usr/bin/valac-0.52 (valac 0.52.4) Host machine cpu family: sparc64 Host machine cpu: sparc64 ../umockdev-0.16.1/meson.build:24: WARNING: Consider using the built-in werror option instead of using "-Werror". Program g-ir-compiler found: YES (/usr/bin/g-ir-compiler) […] >>> Compiling source in /var/tmp/portage/dev-util/umockdev-0.16.1-r1/work/umockdev-0.16.1 ... * .sparc32: running multilib-minimal_abi_src_compile meson compile -C /var/tmp/portage/dev-util/umockdev-0.16.1-r1/work/umockdev-0.16.1-.sparc32 --jobs 20 --load-average 40 --verbose [1/51] sparc-unknown-linux-gnu-gcc -Ilibumockdev-preload.so.0.0.0.p -I. -I../umockdev-0.16.1 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -Werror=missing-prototypes -Werror=strict-prototypes -Werror=nested-externs -Werror=pointer-arith -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=unused-variable -Werror=return-type -Werror=uninitialized -O2 -mcpu=niagara2 -pipe -Wcast-align -fPIC -fvisibility=default -MD -MQ libumockdev-preload.so.0.0.0.p/src_libumockdev-preload.c.o -MF libumockdev-preload.so.0.0.0.p/src_libumockdev-preload.c.o.d -o libumockdev-preload.so.0.0.0.p/src_libumockdev-preload.c.o -c ../umockdev-0.16.1/src/libumockdev-preload.c FAILED: libumockdev-preload.so.0.0.0.p/src_libumockdev-preload.c.o sparc-unknown-linux-gnu-gcc -Ilibumockdev-preload.so.0.0.0.p -I. -I../umockdev-0.16.1 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -Werror=missing-prototypes -Werror=strict-prototypes -Werror=nested-externs -Werror=pointer-arith -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=unused-variable -Werror=return-type -Werror=uninitialized -O2 -mcpu=niagara2 -pipe -Wcast-align -fPIC -fvisibility=default -MD -MQ libumockdev-preload.so.0.0.0.p/src_libumockdev-preload.c.o -MF libumockdev-preload.so.0.0.0.p/src_libumockdev-preload.c.o.d -o libumockdev-preload.so.0.0.0.p/src_libumockdev-preload.c.o -c ../umockdev-0.16.1/src/libumockdev-preload.c ../umockdev-0.16.1/src/libumockdev-preload.c: In function ?netlink_recvmsg?: ../umockdev-0.16.1/src/libumockdev-preload.c:418:27: error: cast increases required alignment of target type [-Werror=cast-align] 418 | struct ucred *cred = (struct ucred *)CMSG_DATA(cmsg); | ^ cc1: all warnings being treated as errors
Unfortunately, they are passing -Werror via project arguments instead of using the werror project option. I created a PR to fix that. https://github.com/martinpitt/umockdev/pull/146 Once applied, we can disable Werror by passing -Dwerror=false to meson setup.
Also, you should probably report that alignment issue upstream.
(In reply to Mike Gilbert from comment #2) > Also, you should probably report that alignment issue upstream. https://github.com/martinpitt/umockdev/issues/147
I'm not sure if there actually is a problem with the code, sometimes these warnings are wrong because they took care to pass only valid data. At the moment it just fails to build.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ff21acef711a9a7c6f686d131bf87ebad89593c2 commit ff21acef711a9a7c6f686d131bf87ebad89593c2 Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2021-09-12 19:45:36 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2021-09-12 19:45:36 +0000 dev-util/umockdev: drop -Werror from project arguments Closes: https://bugs.gentoo.org/812461 Signed-off-by: Mike Gilbert <floppym@gentoo.org> .../umockdev/files/umockdev-0.16.1-Werror.patch | 24 ++++++++++++++++++++++ dev-util/umockdev/umockdev-0.16.1-r1.ebuild | 3 +++ dev-util/umockdev/umockdev-0.16.2.ebuild | 3 +++ 3 files changed, 30 insertions(+)