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.
Created attachment 242299 [details] mail/panda-cclient: fix build with clang 16
Approved, thanks! Do you intend to submit this patch upstream? https://github.com/nkhorman/panda-imap
(In reply to Thierry Thomas from comment #2) I can try, but it looks a bit like the program hasn't been maintained for years? Then again the GitHub repository appears to be a fork by somebody else than the original author, so maybe they have volunteered. :)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=7c711691b378bee218c41da6b803b655f2039d2d commit 7c711691b378bee218c41da6b803b655f2039d2d Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2023-05-20 19:25:40 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2023-05-21 14:47:58 +0000 mail/panda-cclient: fix build with clang 16 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. PR: 271539 Approved by: thierry (maintainer) MFH: 2023Q2 mail/panda-cclient/Makefile | 2 +- .../files/patch-src_osdep_unix_mh.c (new) | 35 ++++++++++++++ .../files/patch-src_osdep_unix_mix.c (new) | 54 ++++++++++++++++++++++ .../files/patch-src_osdep_unix_mx.c (new) | 35 ++++++++++++++ .../files/patch-src_osdep_unix_news.c (new) | 35 ++++++++++++++ 5 files changed, 160 insertions(+), 1 deletion(-)
(In reply to Dimitry Andric from comment #3) Yes, the original author (Mark Crispin) died several years ago, and Neal Horman forked his repository; he accepts pull requests.