Bug 268816 - japanese/FreeWnn-lib: fix build with clang 15
Summary: japanese/FreeWnn-lib: fix build with clang 15
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Hiroki Sato
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-07 16:08 UTC by Dimitry Andric
Modified: 2023-01-07 17:39 UTC (History)
0 users

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


Attachments
japanese/FreeWnn-lib: fix build with clang 15 (1.56 KB, patch)
2023-01-07 16:08 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-01-07 16:08:03 UTC
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.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-01-07 16:08:24 UTC
Created attachment 239334 [details]
japanese/FreeWnn-lib: fix build with clang 15
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-01-07 17:38:57 UTC
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(-)
Comment 3 Hiroki Sato freebsd_committer freebsd_triage 2023-01-07 17:39:53 UTC
Tested and committed the patch.  Thanks a lot!