Bug 271521 - x11-toolkits/p5-Tk: fix build with clang 16
Summary: x11-toolkits/p5-Tk: fix build with clang 16
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: Dimitry Andric
URL:
Keywords:
Depends on:
Blocks: 271047
  Show dependency treegraph
 
Reported: 2023-05-19 20:35 UTC by Dimitry Andric
Modified: 2023-05-19 22:30 UTC (History)
0 users

See Also:
pi: maintainer-feedback+


Attachments
x11-toolkits/p5-Tk: fix build with clang 16 (1.56 KB, patch)
2023-05-19 20:35 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-05-19 20:35:20 UTC
Clang 16 has a new error about incompatible function types, which shows
up when building x11-toolkits/p5-Tk:

  ./Xlib.t:334:14: error: incompatible function pointer types initializing 'KeySym (*)(Display *, unsigned int, int)' (aka 'unsigned long (*)(struct _XDisplay *, unsigned int, int)') with an expression of type 'KeySym (Display *, KeyCode, int)' (aka 'unsigned long (struct _XDisplay *, unsigned char, int)') [-Wincompatible-function-pointer-types]
  VFUNC(KeySym,XKeycodeToKeysym,V_XKeycodeToKeysym,_ANSI_ARGS_((Display *, unsigned int, int)))
               ^~~~~~~~~~~~~~~~

Indeed, the XKeycodeToKeysum function takes a 'KeyCode' as its second
parameter. Patch Xlib.t to make it so.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-05-19 20:35:35 UTC
Created attachment 242288 [details]
x11-toolkits/p5-Tk: fix build with clang 16
Comment 2 Kurt Jaeger freebsd_committer freebsd_triage 2023-05-19 21:02:35 UTC
Approved, please commit.
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-05-19 22:18:50 UTC
A commit in branch main references this bug:

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

commit ecedf2f3cd2c933fb5df179f174c704c89cf1f31
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-05-19 20:32:01 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-05-19 22:16:54 +0000

    x11-toolkits/p5-Tk: fix build with clang 16

    Clang 16 has a new error about incompatible function types, which shows
    up when building x11-toolkits/p5-Tk:

      ./Xlib.t:334:14: error: incompatible function pointer types initializing 'KeySym (*)(Display *, unsigned int, int)' (aka 'unsigned long (*)(struct _XDisplay *, unsigned int, int)') with an expression of type 'KeySym (Display *, KeyCode, int)' (aka 'unsigned long (struct _XDisplay *, unsigned char, int)') [-Wincompatible-function-pointer-types]
      VFUNC(KeySym,XKeycodeToKeysym,V_XKeycodeToKeysym,_ANSI_ARGS_((Display *, unsigned int, int)))
                   ^~~~~~~~~~~~~~~~

    Indeed, the XKeycodeToKeysum function takes a 'KeyCode' as its second
    parameter. Patch Xlib.t to make it so.

    PR:             271521
    Approved by:    pi (maintainer)
    MFH:            2023Q2

 x11-toolkits/p5-Tk/Makefile                     |  1 +
 x11-toolkits/p5-Tk/files/patch-pTk_Xlib.t (new) | 11 +++++++++++
 2 files changed, 12 insertions(+)