Bug 272103 - net-im/libpurple: fix build with clang 16
Summary: net-im/libpurple: fix build with clang 16
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Joe Marcus Clarke
URL:
Keywords:
Depends on:
Blocks: 271047
  Show dependency treegraph
 
Reported: 2023-06-20 19:28 UTC by Dimitry Andric
Modified: 2023-06-24 14:20 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (marcus)


Attachments
net-im/libpurple: fix build with clang 16 (4.98 KB, patch)
2023-06-20 19:28 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2023-06-20 19:28:15 UTC
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.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-06-20 19:28:35 UTC
Created attachment 242895 [details]
net-im/libpurple: fix build with clang 16
Comment 2 Joe Marcus Clarke freebsd_committer freebsd_triage 2023-06-24 14:20:03 UTC
Committed, thanks!
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-06-24 14:20:04 UTC
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(+)