[Bug 271539] mail/panda-cclient: fix build with clang 16

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 20 May 2023 19:30:12 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271539

            Bug ID: 271539
           Summary: mail/panda-cclient: 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: thierry@FreeBSD.org
          Reporter: dim@FreeBSD.org
          Assignee: thierry@FreeBSD.org
             Flags: maintainer-feedback?(thierry@FreeBSD.org)

Clang 16 has a new error about incompatible function types, which shows
up when building mail/panda-cclient:

  news.c:370:36: error: incompatible function pointer types passing 'int
(struct dirent *)' to parameter of type 'int (*)(const struct dirent *)'
[-Wincompatible-function-pointer-types]
    if ((nmsgs = scandir (tmp,&names,news_select,news_numsort)) >= 0) {
                                     ^~~~~~~~~~~
  /usr/include/dirent.h:127:12: note: passing argument to parameter here
              int (*)(const struct dirent *), int (*)(const struct dirent **,
                    ^
  news.c:370:48: error: incompatible function pointer types passing 'int (const
void *, const void *)' to parameter of type 'int (*)(const struct dirent **,
const struct dirent **)' [-Wincompatible-function-pointer-types]
    if ((nmsgs = scandir (tmp,&names,news_select,news_numsort)) >= 0) {
                                                 ^~~~~~~~~~~~
  /usr/include/dirent.h:127:44: note: passing argument to parameter here
              int (*)(const struct dirent *), int (*)(const struct dirent **,
                                                    ^

This is because the prototypes for the scandir(3) 'select' and 'compar'
callback function parameters do not match the declarations in
<dirent.h>. The same occurs in a few other files under src/osdep/unix.

Fix these by using the correct parameter types for the callback functions.

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