Build failure with upcoming Clang 16 (-Wincompatible-function-pointer-types)
Clang 16 will make -Wincompatible-function-pointer-types an error by default.
You can emulate this error using:
GCC via -Werror=incompatible-pointer-types (GCC lacks a more specific warning for just func. ptrs) Clang <16 via -Werror=incompatible-function-pointer-types
Originally reported downstream in Gentoo at https://bugs.gentoo.org/880969.
Full build log: https://bugs.gentoo.org/attachment.cgi?id=831315 (bzip2'd).
Error:
libtool: compile: clang -DHAVE_CONFIG_H -I. -I.. -I../include -DXAW_INTERNATIONALIZATION -DXAW_GRAY_BLKWHT_STIPPLES -DXAW_ARROW_SCROLLBARS -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 -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 -pipe -march=native -fno-diagnostics-color -O2 -Werror=implicit-function-declaration -Werror=implicit-int -c MenuButton.c -fPIC -DPIC -o .libs/MenuButton.o
XawIm.c:1376:6: error: incompatible function pointer types passing
'void (Widget)' (aka 'void (struct _WidgetRec *)') to parameter of type
'XtEventHandler' (aka 'void (*)(struct _WidgetRec *, void *, union _XEvent
*, char *)') [-Werror,-Wincompatible-function-pointer-types]
XawVendorShellExtResize, (XtPointer)NULL );
^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/X11/Intrinsic.h:840:31: note: passing argument to parameter here
XtEventHandler /* proc */,
^
1 warning and 1 error generated.
[...]