aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo-Chuan Hsieh <sunpoet@FreeBSD.org>2023-07-09 10:25:37 +0000
committerPo-Chuan Hsieh <sunpoet@FreeBSD.org>2023-07-09 10:25:37 +0000
commit9f2c8360e8a2b7b39910a3d7359242338205fc15 (patch)
tree5defb4cac127a27c62bdf0335c169830a397e23d
parent76d24c4965a552f963493dc9a33852b2173977a4 (diff)
downloadports-9f2c8360e8a2b7b39910a3d7359242338205fc15.tar.gz
ports-9f2c8360e8a2b7b39910a3d7359242338205fc15.zip
devel/rubygem-unicode: Fix build with Clang 16 and remove the workaround
unicode.c:1039:20: error: incompatible function pointer types passing 'VALUE (get_categories_param *)' (aka 'unsigned long (struct _get_categories_param *)') to parameter of type 'VALUE (*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') [-Wincompatible-function-pointer-types] return rb_ensure(get_categories_internal, (VALUE)&param, ^~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/ruby-3.1/ruby/internal/iterator.h:425:25: note: passing argument to parameter 'b_proc' here VALUE rb_ensure(VALUE (*b_proc)(VALUE), VALUE data1, VALUE (*e_proc)(VALUE), VALUE data2); ^ unicode.c:1040:20: error: incompatible function pointer types passing 'VALUE (WString *)' (aka 'unsigned long (struct _WString *)') to parameter of type 'VALUE (*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') [-Wincompatible-function-pointer-types] get_categories_ensure, (VALUE)&wstr); ^~~~~~~~~~~~~~~~~~~~~ /usr/local/include/ruby-3.1/ruby/internal/iterator.h:425:62: note: passing argument to parameter 'e_proc' here VALUE rb_ensure(VALUE (*b_proc)(VALUE), VALUE data1, VALUE (*e_proc)(VALUE), VALUE data2); ^ unicode.c:1057:20: error: incompatible function pointer types passing 'VALUE (get_categories_param *)' (aka 'unsigned long (struct _get_categories_param *)') to parameter of type 'VALUE (*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') [-Wincompatible-function-pointer-types] return rb_ensure(get_categories_internal, (VALUE)&param, ^~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/ruby-3.1/ruby/internal/iterator.h:425:25: note: passing argument to parameter 'b_proc' here VALUE rb_ensure(VALUE (*b_proc)(VALUE), VALUE data1, VALUE (*e_proc)(VALUE), VALUE data2); ^ unicode.c:1058:20: error: incompatible function pointer types passing 'VALUE (WString *)' (aka 'unsigned long (struct _WString *)') to parameter of type 'VALUE (*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') [-Wincompatible-function-pointer-types] get_categories_ensure, (VALUE)&wstr); ^~~~~~~~~~~~~~~~~~~~~ /usr/local/include/ruby-3.1/ruby/internal/iterator.h:425:62: note: passing argument to parameter 'e_proc' here VALUE rb_ensure(VALUE (*b_proc)(VALUE), VALUE data1, VALUE (*e_proc)(VALUE), VALUE data2); ^ unicode.c:1227:20: error: incompatible function pointer types passing 'VALUE (get_text_elements_param *)' (aka 'unsigned long (struct _get_text_elements_param *)') to parameter of type 'VALUE (*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') [-Wincompatible-function-pointer-types] return rb_ensure(get_text_elements_internal, (VALUE)&param, ^~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/ruby-3.1/ruby/internal/iterator.h:425:25: note: passing argument to parameter 'b_proc' here VALUE rb_ensure(VALUE (*b_proc)(VALUE), VALUE data1, VALUE (*e_proc)(VALUE), VALUE data2); ^ unicode.c:1228:20: error: incompatible function pointer types passing 'VALUE (WString *)' (aka 'unsigned long (struct _WString *)') to parameter of type 'VALUE (*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') [-Wincompatible-function-pointer-types] get_text_elements_ensure, (VALUE)&wstr); ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/ruby-3.1/ruby/internal/iterator.h:425:62: note: passing argument to parameter 'e_proc' here VALUE rb_ensure(VALUE (*b_proc)(VALUE), VALUE data1, VALUE (*e_proc)(VALUE), VALUE data2); ^ 20 warnings and 6 errors generated.
-rw-r--r--devel/rubygem-unicode/Makefile6
-rw-r--r--devel/rubygem-unicode/files/patch-clang1635
2 files changed, 35 insertions, 6 deletions
diff --git a/devel/rubygem-unicode/Makefile b/devel/rubygem-unicode/Makefile
index 2dd1cd924632..80b0f11e736c 100644
--- a/devel/rubygem-unicode/Makefile
+++ b/devel/rubygem-unicode/Makefile
@@ -11,10 +11,4 @@ LICENSE= RUBY
USES= gem
-.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/devel/rubygem-unicode/files/patch-clang16 b/devel/rubygem-unicode/files/patch-clang16
new file mode 100644
index 000000000000..998fecd504ff
--- /dev/null
+++ b/devel/rubygem-unicode/files/patch-clang16
@@ -0,0 +1,35 @@
+--- ext/unicode/unicode.c.orig 2023-07-03 15:50:18 UTC
++++ ext/unicode/unicode.c
+@@ -1036,8 +1036,8 @@ unicode_get_categories(VALUE obj, VALUE str)
+ #endif
+ WStr_allocWithUTF8L(&wstr, RSTRING_PTR(str), RSTRING_LEN(str));
+
+- return rb_ensure(get_categories_internal, (VALUE)&param,
+- get_categories_ensure, (VALUE)&wstr);
++ return rb_ensure((VALUE (*)(VALUE)) get_categories_internal, (VALUE)&param,
++ (VALUE (*)(VALUE)) get_categories_ensure, (VALUE)&wstr);
+ /* wstr will be freed in get_text_elements_ensure() */
+ }
+
+@@ -1054,8 +1054,8 @@ unicode_get_abbr_categories(VALUE obj, VALUE str)
+ #endif
+ WStr_allocWithUTF8L(&wstr, RSTRING_PTR(str), RSTRING_LEN(str));
+
+- return rb_ensure(get_categories_internal, (VALUE)&param,
+- get_categories_ensure, (VALUE)&wstr);
++ return rb_ensure((VALUE (*)(VALUE)) get_categories_internal, (VALUE)&param,
++ (VALUE (*)(VALUE)) get_categories_ensure, (VALUE)&wstr);
+ /* wstr will be freed in get_text_elements_ensure() */
+ }
+
+@@ -1224,8 +1224,8 @@ unicode_get_text_elements(VALUE obj, VALUE str)
+ #endif
+ WStr_allocWithUTF8L(&wstr, RSTRING_PTR(str), RSTRING_LEN(str));
+
+- return rb_ensure(get_text_elements_internal, (VALUE)&param,
+- get_text_elements_ensure, (VALUE)&wstr);
++ return rb_ensure((VALUE (*)(VALUE)) get_text_elements_internal, (VALUE)&param,
++ (VALUE (*)(VALUE)) get_text_elements_ensure, (VALUE)&wstr);
+ /* wstr will be freed in get_text_elements_ensure() */
+ }
+