Build failure with stricter C compilers (e.g. GCC 14)
Modern C compilers are becoming stricter with a variety of changes over the last year or so.
GCC 14 in particular (to be released in ~April 2024) fails to build xlsfonts-1.0.7 like:
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wlogical-op -Wimplicit -Wnonnull -Winit-self -Wmain -Wmissing-braces -Wsequence-point -Wreturn-type -Wtrigraphs -Warray-bounds -Wwrite-strings -Waddress -Wint-to-pointer-cast -Wpointer-to-int-cast -fno-strict-aliasing -O3 -pipe -march=native -fno-diagnostics-color -c -o xlsfonts.o xlsfonts.c
xlsfonts.c: In function ‘get_list’:
xlsfonts.c:204:23: error: assignment to ‘char **’ from incompatible pointer type ‘const char **’ [-Wincompatible-pointer-types]
204 | fonts = &pattern;
| ^
Originally reported downstream in Gentoo at https://bugs.gentoo.org/919204.
This can be emulated with -Werror=incompatible-pointer-types -Werror=implicit -Werror=int-conversion
on an older GCC or Clang.