Bug 272136 - textproc/discount: fix build with clang 16
Summary: textproc/discount: fix build with clang 16
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks: 271047
  Show dependency treegraph
 
Reported: 2023-06-21 19:29 UTC by Dimitry Andric
Modified: 2023-07-01 17:56 UTC (History)
0 users

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


Attachments
textproc/discount: fix build with clang 16 (1.67 KB, patch)
2023-06-21 19:29 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-21 19:29:03 UTC
Clang 16 has a new error about incompatible function types, which shows
up when textproc/discount:

  main.c:311:29: error: incompatible function pointer types passing 'char *(char *, int, char *)' to parameter of type 'mkd_callback_t' (aka 'char *(*)(const char *, const int, void *)') [-Wincompatible-function-pointer-types]
              mkd_e_code_format(doc, external_codefmt);
                                     ^~~~~~~~~~~~~~~~
  ./mkdio.h:71:45: note: passing argument to parameter here
  void mkd_e_code_format(void*, mkd_callback_t);
                                              ^

This is is because the callback function's prototype does not match the
mkd_callback_t type. The program is rather sloppy with how it passes
parameters around, and just before this particular callback assignment
it casts the parameter to the desired type, so also do that here.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-06-21 19:29:24 UTC
Created attachment 242930 [details]
textproc/discount: fix build with clang 16
Comment 2 Po-Chuan Hsieh freebsd_committer freebsd_triage 2023-07-01 17:56:17 UTC
I did that in ports 249dd4b7de80bddef241339dff6b4d7993414a33. Thanks.