[Bug 272136] textproc/discount: fix build with clang 16

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 21 Jun 2023 19:29:03 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272136

            Bug ID: 272136
           Summary: textproc/discount: fix build with clang 16
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: sunpoet@FreeBSD.org
          Reporter: dim@FreeBSD.org
             Flags: maintainer-feedback?(sunpoet@FreeBSD.org)
          Assignee: sunpoet@FreeBSD.org

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.