During an exp-run for llvm 15 (see bug 265425), it turned out that japanese/FreeWnn-lib failed to build with clang 15: js.c:1029:28: error: incompatible pointer to integer conversion returning 'void *' from a function with result type 'int' [-Wint-conversion] handler_of_jserver_dead (NULL); ^~~~ /usr/include/sys/_null.h:34:14: note: expanded from macro 'NULL' #define NULL ((void *)0) ^~~~~~~~~~~ js.c:150:24: note: expanded from macro 'handler_of_jserver_dead' return err_val; \ ^~~~~~~ This is because the js_disconnect() function should return an integer, not a pointer. Use the error value -1 instead.
Created attachment 239334 [details] japanese/FreeWnn-lib: fix build with clang 15
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=fa63f46a757eb3c9832ba951800dcac7e3552c09 commit fa63f46a757eb3c9832ba951800dcac7e3552c09 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2023-01-07 17:15:22 +0000 Commit: Hiroki Sato <hrs@FreeBSD.org> CommitDate: 2023-01-07 17:35:40 +0000 japanese/FreeWnn-lib: fix build with clang 15 During an exp-run for llvm 15 (see bug 265425), it turned out that japanese/FreeWnn-lib failed to build with clang 15: js.c:1029:28: error: incompatible pointer to integer conversion returning 'void *' from a function with result type 'int' [-Wint-conversion] handler_of_jserver_dead (NULL); ^~~~ /usr/include/sys/_null.h:34:14: note: expanded from macro 'NULL' #define NULL ((void *)0) ^~~~~~~~~~~ js.c:150:24: note: expanded from macro 'handler_of_jserver_dead' return err_val; \ ^~~~~~~ This is because the js_disconnect() function should return an integer, not a pointer. Use the error value -1 instead. PR: 268816 japanese/FreeWnn-lib/files/patch-Wnn-jlib-js.c | 279 ++++++++++++------------- 1 file changed, 135 insertions(+), 144 deletions(-)
Tested and committed the patch. Thanks a lot!