Clang 16 has a new error about incompatible function types, which shows up when building x11-toolkits/open-motif: WmError.c:134:24: error: incompatible function pointer types passing 'void (char *)' to parameter of type 'void (*)(String) __attribute__((noreturn))' (aka 'void (*)(char *) __attribute__((noreturn))') [-Wincompatible-function-pointer-types] XtSetErrorHandler (WmXtErrorHandler); ^~~~~~~~~~~~~~~~ /usr/local/include/X11/Intrinsic.h:1776:1: note: passing argument to parameter here ); ^ In this case the declaration of the callback function for XtSetErrorHandler() shoud have a noreturn attribute, specifically using the _X_NORETURN macro.
Created attachment 242176 [details] x11-toolkits/open-motif: fix build with clang 16
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=72d0d9b5dad67545e571057abd8d59166ce247b2 commit 72d0d9b5dad67545e571057abd8d59166ce247b2 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2023-05-15 14:17:12 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2023-05-15 14:36:17 +0000 x11-toolkits/open-motif*: fix build with clang 16 Clang 16 has a new error about incompatible function types, which shows up when building x11-toolkits/open-motif: WmError.c:134:24: error: incompatible function pointer types passing 'void (char *)' to parameter of type 'void (*)(String) __attribute__((noreturn))' (aka 'void (*)(char *) __attribute__((noreturn))') [-Wincompatible-function-pointer-types] XtSetErrorHandler (WmXtErrorHandler); ^~~~~~~~~~~~~~~~ /usr/local/include/X11/Intrinsic.h:1776:1: note: passing argument to parameter here ); ^ In this case the declaration of the callback function for XtSetErrorHandler() shoud have a noreturn attribute, specifically using the _X_NORETURN macro. PR: 271425 .../open-motif-devel/files/patch-clients_mwm_WmError.h (new) | 11 +++++++++++ .../open-motif/files/patch-clients_mwm_WmError.h (new) | 11 +++++++++++ 2 files changed, 22 insertions(+)
Fixed. Thanks for the patch.