Bug 272019 - graphics/ocaml-lablgl: fix build with clang 16
Summary: graphics/ocaml-lablgl: 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-06-15 19:37 UTC by Dimitry Andric
Modified: 2023-06-16 18:08 UTC (History)
1 user (show)

See Also:


Attachments
graphics/ocaml-lablgl: fix build with clang 16 (1.56 KB, patch)
2023-06-15 19:38 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-06-15 19:37:47 UTC
Clang 16 has a new error about incompatible function types, which shows
up when building graphics/ocaml-lablgl:

  togl.c:820:26: error: incompatible function pointer types assigning to 'void (*)(Tk_Window, Tk_ClassProcs *, ClientData)' (aka 'void (*)(struct Tk_Window_ *, struct Tk_ClassProcs *, void *)') from 'void (Tk_Window, const Tk_ClassProcs *, ClientData)' (aka 'void (struct Tk_Window_ *, const struct Tk_ClassProcs *, void *)') [-Wincompatible-function-pointer-types]
          SetClassProcsPtr = Tk_SetClassProcs;
                           ^ ~~~~~~~~~~~~~~~~

This is because Tk_SetClassProcs() now takes a const Tk_ClassProcs
pointer as its second parameter. Fix the SetClassProcsPtr declaration to
match.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-06-15 19:38:06 UTC
Created attachment 242799 [details]
graphics/ocaml-lablgl: fix build with clang 16
Comment 2 Fernando Apesteguía freebsd_committer freebsd_triage 2023-06-16 08:25:31 UTC
^Triage: reporter is committer, assign accordingly.

LGTM.

Builds fine with current LLVM_DEFAULT and with llvm=16. Tested in 12.4{amd64,i386} and -current amd64
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-06-16 18:06:59 UTC
A commit in branch main references this bug:

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

commit 0e77cfcef8a5677cff1ba81430b767a1089fd083
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-06-15 19:31:27 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-06-16 18:05:43 +0000

    graphics/ocaml-lablgl: fix build with clang 16

    Clang 16 has a new error about incompatible function types, which shows
    up when building graphics/ocaml-lablgl:

      togl.c:820:26: error: incompatible function pointer types assigning to 'void (*)(Tk_Window, Tk_ClassProcs *, ClientData)' (aka 'void (*)(struct Tk_Window_ *, struct Tk_ClassProcs *, void *)') from 'void (Tk_Window, const Tk_ClassProcs *, ClientData)' (aka 'void (struct Tk_Window_ *, const struct Tk_ClassProcs *, void *)') [-Wincompatible-function-pointer-types]
              SetClassProcsPtr = Tk_SetClassProcs;
                               ^ ~~~~~~~~~~~~~~~~

    This is because Tk_SetClassProcs() now takes a const Tk_ClassProcs
    pointer as its second parameter. Fix the SetClassProcsPtr declaration to
    match.

    PR:             272019
    Approved by:    fernape
    MFH:            2023Q2

 graphics/ocaml-lablgl/files/patch-Togl_src_Togl_togl.c (new) | 11 +++++++++++
 1 file changed, 11 insertions(+)