Bug 268256 - japanese/canna-lib: fix build with clang 15
Summary: japanese/canna-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: 265425
  Show dependency treegraph
 
Reported: 2022-12-08 20:56 UTC by Dimitry Andric
Modified: 2022-12-18 17:48 UTC (History)
0 users

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


Attachments
japanese/canna-lib: fix build with clang 15 (1.40 KB, patch)
2022-12-08 20:56 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 2022-12-08 20:56:06 UTC
During an exp-run for llvm 15 (see bug 265425), it turned out that japanese/canna-lib failed to build with clang 15:

  crxgram.c:421:33: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'char *' [-Wint-conversion]
                  alert("unknown operation %c", op);
                                                ^~
  rkc.c:2741:38: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'unsigned char *' [-Wint-conversion]
    nkanji = _RkwGetSimpleKanji(cxnum, dicname, cbuf, len,
                                       ^~~~~~~

This is mostly expected as canna-lib is very old K&R code, and clang 15 has -Wint-conversion as an error by default.

Pass -Wno-error=int-conversion in CCOPTIONS to make the warning non-fatal. This should work for both clang and gcc.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2022-12-08 20:56:34 UTC
Created attachment 238645 [details]
japanese/canna-lib: fix build with clang 15
Comment 2 commit-hook freebsd_committer freebsd_triage 2022-12-18 17:44:29 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d5e379f66074db6b70a6c96d756965e6db925342

commit d5e379f66074db6b70a6c96d756965e6db925342
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-12-08 20:51:58 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-12-18 17:27:33 +0000

    japanese/canna-lib: fix build with clang 15

    During an exp-run for llvm 15 (see bug 265425), it turned out that
    japanese/canna-lib failed to build with clang 15:

      crxgram.c:421:33: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'char *' [-Wint-conversion]
                      alert("unknown operation %c", op);
                                                    ^~
      rkc.c:2741:38: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'unsigned char *' [-Wint-conversion]
        nkanji = _RkwGetSimpleKanji(cxnum, dicname, cbuf, len,
                                           ^~~~~~~

    This is mostly expected as canna-lib is very old K&R code, and clang 15
    has -Wint-conversion as an error by default.

    Pass -Wno-error=int-conversion in CCOPTIONS to make the warning
    non-fatal. This should work for both clang and gcc.

    PR:             268256
    Approved by:    portmgr (tcberner)
    MFH:            2022Q4

 japanese/canna-lib/Makefile | 1 +
 1 file changed, 1 insertion(+)