Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Jun 2023 07:22:30 GMT
From:      Po-Chuan Hsieh <sunpoet@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 463e93ce0595 - main - net/rubygem-ovirt-engine-sdk: Fix build with Clang 16 and remove the workaround
Message-ID:  <202306300722.35U7MUhh083237@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by sunpoet:

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

commit 463e93ce059522a1f1a93474bb41f90561b77d4f
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2023-06-30 07:07:47 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2023-06-30 07:07:47 +0000

    net/rubygem-ovirt-engine-sdk: Fix build with Clang 16 and remove the workaround
    
    ov_http_client.c:1001:47: error: incompatible function pointer types passing 'int (VALUE, VALUE, struct curl_slist **)' (aka 'int (unsigned long, unsigned long, struct curl_slist **)') to parameter of type 'int (*)(VALUE, VALUE, VALUE)' (aka 'int (*)(unsigned long, unsigned long, unsigned long)') [-Wincompatible-function-pointer-types]
            rb_hash_foreach(request_ptr->headers, ov_http_client_add_header, (VALUE) headers);
                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/local/include/ruby-3.1/ruby/internal/intern/hash.h:83:40: note: passing argument to parameter 'func' here
    void rb_hash_foreach(VALUE hash, int (*func)(VALUE key, VALUE val, VALUE arg), VALUE arg);
                                           ^
    9 warnings and 1 error generated.
---
 net/rubygem-ovirt-engine-sdk/Makefile            |  6 ------
 net/rubygem-ovirt-engine-sdk/files/patch-clang16 | 11 +++++++++++
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/net/rubygem-ovirt-engine-sdk/Makefile b/net/rubygem-ovirt-engine-sdk/Makefile
index db86b8855b90..f28dce47ede7 100644
--- a/net/rubygem-ovirt-engine-sdk/Makefile
+++ b/net/rubygem-ovirt-engine-sdk/Makefile
@@ -17,10 +17,4 @@ RUN_DEPENDS=	rubygem-json>=1<3:devel/rubygem-json
 USES=		gem gnome
 USE_GNOME=	libxml2
 
-.include <bsd.port.options.mk>
-
-.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1400091
-CONFIGURE_ARGS+=	--with-cflags="-Wno-error=incompatible-function-pointer-types"
-.endif
-
 .include <bsd.port.mk>
diff --git a/net/rubygem-ovirt-engine-sdk/files/patch-clang16 b/net/rubygem-ovirt-engine-sdk/files/patch-clang16
new file mode 100644
index 000000000000..d3eb39b8a84a
--- /dev/null
+++ b/net/rubygem-ovirt-engine-sdk/files/patch-clang16
@@ -0,0 +1,11 @@
+--- ext/ovirtsdk4c/ov_http_client.c.orig	2023-06-24 11:23:37 UTC
++++ ext/ovirtsdk4c/ov_http_client.c
+@@ -998,7 +998,7 @@ static void ov_http_client_prepare_handle(ov_http_clie
+ 
+     /* Set the headers: */
+     if (!NIL_P(request_ptr->headers)) {
+-        rb_hash_foreach(request_ptr->headers, ov_http_client_add_header, (VALUE) headers);
++        rb_hash_foreach(request_ptr->headers, (int (*)(VALUE, VALUE, VALUE)) ov_http_client_add_header, (VALUE) headers);
+     }
+     curl_easy_setopt(handle, CURLOPT_HTTPHEADER, *headers);
+ 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202306300722.35U7MUhh083237>