On Sun, Oct 27, 2024 at 09:19:51AM +0100, Helmut Grohne wrote: > | gcc -I/usr/include/tcl8.6 -g -O2 -Werror=implicit-function-declaration > -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat > -Werror=format-security -DMARCH=\"i386-linux-gnu\" -D_GNU_SOURCE -Wdate-time > -D_FORTIFY_SOURCE=2 -c -o label.o label.c > | newt.c: In function ‘wchar_to_textmod_visual’: > | newt.c:304:17: error: passing argument 1 of ‘func_ptr’ from incompatible > pointer type [-Wincompatible-pointer-types] > | 304 | (*func_ptr)(in, len, base_dir, out, NULL, NULL, NULL); > | | ^~ > | | | > | | wchar_t * {aka long int *} > | newt.c:304:17: note: expected ‘FriBidiChar *’ {aka ‘unsigned int *’} but > argument is of type ‘wchar_t *’ {aka ‘long int *’} > | make[2]: *** [<builtin>: newt.o] Error 1 > | make[2]: *** Waiting for unfinished jobs.... > | make[2]: Leaving directory '/<<PKGBUILDDIR>>' > | dh_auto_build: error: make -j8 returned exit code 2 > | make[1]: *** [debian/rules:51: override_dh_auto_build] Error 25 > | make[1]: Leaving directory '/<<PKGBUILDDIR>>' > | make: *** [debian/rules:14: build] Error 2 > | dpkg-buildpackage: error: debian/rules build subprocess returned exit > status 2
I dug into this a little bit and got some conclusions. in is a wchar_t array and constructed using mbstowcs. FriBidiChar used to be wchar_t before fribidi 1.0.4 imported into Debian in 2018. Since then, i386 produced a warning: https://buildd.debian.org/status/fetch.php?pkg=newt&arch=i386&ver=0.52.24-2%2Bb1&stamp=1720822697&raw=0 | gcc -I/usr/include/tcl8.6 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -DMARCH=\"i386-linux-gnu\" -D_GNU_SOURCE -Wdate-time -D_FORTIFY_SOURCE=2 -c -o checkbox.o checkbox.c | newt.c: In function ‘wchar_to_textmod_visual’: | newt.c:304:17: warning: passing argument 1 of ‘func_ptr’ from incompatible pointer type [-Wincompatible-pointer-types] | 304 | (*func_ptr)(in, len, base_dir, out, NULL, NULL, NULL); | | ^~ | | | | | wchar_t * {aka long int *} In some recent toolchain change, this warning has become an error (probably gcc-14) and now it fails. The wchar_t type is quite architecture dependent. It can be 16bit or 32bit. Its signedness should match that of char. On glibc architectures, it is 32bit. This is why we are not seeing a failure on armel and armhf where char is unsigned. The function wchar_to_textmod_visual where this is happening is declared static and only called two times. In both cases, a const char * string is converted to wchar_t using mbstowcs. Arguably, fribidi did an ABI break in 2018, but it is so long ago that bumping soname no longer makes any sense. fribidi also did the right thing and got rid of wchar_t as dealing with that type is very platform dependent. Ubuntu also encountered this bug https://bugs.launchpad.net/ubuntu/+source/newt/+bug/2083549 and opted for just casting the pointer. What could possibly go wrong? Helmut