Clang 16 has a new error about incompatible function types, which shows up when net-im/libpurple: auth_cyrus.c:376:23: error: incompatible function pointer types assigning to 'int (*)(void)' from 'int (void *, int, const char **, const char **)' [-Wincompatible-function-pointer-types] js->sasl_cb[id].proc = jabber_sasl_cb_realm; ^ ~~~~~~~~~~~~~~~~~~~~ auth_cyrus.c:381:23: error: incompatible function pointer types assigning to 'int (*)(void)' from 'int (void *, int, const char **, unsigned int *)' [-Wincompatible-function-pointer-types] js->sasl_cb[id].proc = jabber_sasl_cb_simple; ^ ~~~~~~~~~~~~~~~~~~~~~ auth_cyrus.c:386:23: error: incompatible function pointer types assigning to 'int (*)(void)' from 'int (void *, int, const char **, unsigned int *)' [-Wincompatible-function-pointer-types] js->sasl_cb[id].proc = jabber_sasl_cb_simple; ^ ~~~~~~~~~~~~~~~~~~~~~ auth_cyrus.c:393:24: error: incompatible function pointer types assigning to 'int (*)(void)' from 'int (sasl_conn_t *, void *, int, sasl_secret_t **)' (aka 'int (struct sasl_conn *, void *, int, struct sasl_secret **)') [-Wincompatible-function-pointer-types] js->sasl_cb[id].proc = jabber_sasl_cb_secret; ^ ~~~~~~~~~~~~~~~~~~~~~ auth_cyrus.c:399:23: error: incompatible function pointer types assigning to 'int (*)(void)' from 'int (void *, int, const char *)' [-Wincompatible-function-pointer-types] js->sasl_cb[id].proc = jabber_sasl_cb_log; ^ ~~~~~~~~~~~~~~~~~~ This is because the sasl headers declare the callback functions as int(*)(void), even when the actual arguments actually different. Cast the values assigned to the .proc fields to fix the warnings.
Created attachment 242895 [details] net-im/libpurple: fix build with clang 16
Committed, thanks!
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=a71db64dbe83166bf7ff42f6208b0668c76c5c65 commit a71db64dbe83166bf7ff42f6208b0668c76c5c65 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2023-06-24 14:18:52 +0000 Commit: Joe Marcus Clarke <marcus@FreeBSD.org> CommitDate: 2023-06-24 14:19:44 +0000 net-im/libpurple: fix build with clang 16 PR: 272103 .../patch-libpurple_protocols_irc_msgs.c (new) | 29 +++++++++++++++++ ...-libpurple_protocols_jabber_auth__cyrus.c (new) | 38 ++++++++++++++++++++++ 2 files changed, 67 insertions(+)