Bug 271540 - net/rubygem-grpc: fix build with clang 16
Summary: net/rubygem-grpc: 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-20 20:19 UTC by Dimitry Andric
Modified: 2023-05-23 14:17 UTC (History)
0 users

See Also:
sunpoet: maintainer-feedback+


Attachments
net/rubygem-grpc: fix build with clang 16 (2.38 KB, patch)
2023-05-20 20:19 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-20 20:19:00 UTC
Clang 16 has a new error about incompatible function types, which shows
up when building net/rubygem-grpc:

  rb_channel.c:764:40: error: incompatible function pointer types passing 'VALUE (VALUE)' (aka 'unsigned long (unsigned long)') to parameter of type 'VALUE (*)(void *)' (aka 'unsigned long (*)(void *)') [-Wincompatible-function-pointer-types]
    background_thread = rb_thread_create(run_poll_channels_loop, NULL);
                                         ^~~~~~~~~~~~~~~~~~~~~~
  /usr/local/include/ruby-3.1/ruby/internal/intern/thread.h:190:32: note: passing argument to parameter 'f' here
  VALUE rb_thread_create(VALUE (*f)(void *g), void *g);
                                 ^

Fix it by adjusting the parameters for the thread callback functions.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-05-20 20:19:23 UTC
Created attachment 242301 [details]
net/rubygem-grpc: fix build with clang 16
Comment 2 Po-Chuan Hsieh freebsd_committer freebsd_triage 2023-05-22 15:20:05 UTC
LGTM. Please add the patch as patch-clang16. Thanks.
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-05-23 14:16:29 UTC
A commit in branch main references this bug:

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

commit 8759687fa0d46934e4d3af6b844adb56607b4689
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-05-20 20:06:45 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-05-23 14:15:21 +0000

    net/rubygem-grpc: fix build with clang 16

    Clang 16 has a new error about incompatible function types, which shows
    up when building net/rubygem-grpc:

      rb_channel.c:764:40: error: incompatible function pointer types passing 'VALUE (VALUE)' (aka 'unsigned long (unsigned long)') to parameter of type 'VALUE (*)(void *)' (aka 'unsigned long (*)(void *)') [-Wincompatible-function-pointer-types]
        background_thread = rb_thread_create(run_poll_channels_loop, NULL);
                                             ^~~~~~~~~~~~~~~~~~~~~~
      /usr/local/include/ruby-3.1/ruby/internal/intern/thread.h:190:32: note: passing argument to parameter 'f' here
      VALUE rb_thread_create(VALUE (*f)(void *g), void *g);
                                     ^

    Fix it by adjusting the parameters for the thread callback functions.

    PR:             271540
    Approved by:    sunpoet (maintainer)
    MFH:            2023Q2

 net/rubygem-grpc/Makefile                  |  1 +
 net/rubygem-grpc/files/patch-clang16 (new) | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)