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
I think going with the Ubuntu solution for now looks like the most
pragmatic answer.
A rewrite to UTF8 would be preferable, I will see whats involved but its
unlikely.
Alastair
--
Alastair McKinstry,
GPG: 82383CE9165B347C787081A2CBE6BB4E5D9AD3A5
e: alast...@mckinstry.ie, im: @alastair:mckinstry.ie @amckins...@mastodon.ie
Commander Vimes didn’t like the phrase “The innocent have nothing to fear,”
believing the innocent had everything to fear, mostly from the guilty but in
the longer term
even more from those who say things like “The innocent have nothing to fear.”
- T. Pratchett, Snuff