FreeBSD Bugzilla – Attachment 241978 Details for
Bug 271245
www/rubygem-hpricot: fix build with clang 16
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
www/rubygem-hpricot: fix build with clang 16
www__rubygem-hpricot-fix-clang16-build-1.diff (text/plain), 3.96 KB, created by
Dimitry Andric
on 2023-05-04 18:19:29 UTC
(
hide
)
Description:
www/rubygem-hpricot: fix build with clang 16
Filename:
MIME Type:
Creator:
Dimitry Andric
Created:
2023-05-04 18:19:29 UTC
Size:
3.96 KB
patch
obsolete
>commit 1c5b0a510321d8f160044a6f60c27c1187635bcb >Author: Dimitry Andric <dim@FreeBSD.org> >Date: 2023-05-04 20:17:18 +0200 > > www/rubygem-hpricot: fix build with clang 16 > > Clang 16 has a new error about incompatible function types, which shows > up when building www/rubygem-hpricot: > > fast_xs.c:165:39: error: incompatible function pointer types passing 'VALUE (VALUE)' (aka 'unsigned long (unsigned long)') to parameter of type 'VALUE (*)(VALUE, VALUE)' (aka 'unsigned long (*)(unsigned long, unsigned long)') [-Wincompatible-function-pointer-types] > array = rb_rescue(unpack_utf8, self, unpack_uchar, self); > ^~~~~~~~~~~~ > /usr/local/include/ruby-3.1/ruby/internal/iterator.h:364:62: note: passing argument to parameter 'r_proc' here > VALUE rb_rescue(VALUE (*b_proc)(VALUE), VALUE data1, VALUE (*r_proc)(VALUE, VALUE), VALUE data2); > ^ > > This is because the r_proc parameter of rb_rescue() should be a pointer > to a function taking two VALUE parameters, not one (the second parameter > can contain an exception to be handled). > > Another similar error occurs later in hpricot_scan.c, which was > generated from hpricot_scan.rl: > > hpricot_scan.rl:855:3: error: incompatible function pointer types passing 'VALUE (VALUE, VALUE, VALUE, VALUE, VALUE)' (aka 'unsigned long (unsigned long, unsigned long, unsigned long, unsigned long, unsigned long)') to parameter of type 'VALUE (*)(VALUE, VALUE, VALUE, VALUE)' (aka 'unsigned long (*)(unsigned long, unsigned long, unsigned long, unsigned long)') [-Wincompatible-function-pointer-types] > rb_define_singleton_method(mHpricot, "css", hpricot_css, 3); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > /usr/local/include/ruby-3.1/ruby/internal/anyargs.h:307:143: note: expanded from macro 'rb_define_singleton_method' > #define rb_define_singleton_method(obj, mid, func, arity) RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method((arity), (func))((obj), (mid), (func), (arity)) > ^~~~~~ > /usr/local/include/ruby-3.1/ruby/internal/anyargs.h:270:1: note: passing argument to parameter here > RBIMPL_ANYARGS_DECL(rb_define_singleton_method, VALUE, const char *) > ^ > > This is because the func parameter of rb_define_singleton_method() > should be a pointer to a function taking four VALUE parameters, not five. > >diff --git a/www/rubygem-hpricot/files/patch-ext_fast__xs_fast__xs.c b/www/rubygem-hpricot/files/patch-ext_fast__xs_fast__xs.c >new file mode 100644 >index 000000000000..296a2bcd8b35 >--- /dev/null >+++ b/www/rubygem-hpricot/files/patch-ext_fast__xs_fast__xs.c >@@ -0,0 +1,11 @@ >+--- ext/fast_xs/fast_xs.c.orig 2023-05-04 17:51:30 UTC >++++ ext/fast_xs/fast_xs.c >+@@ -144,7 +144,7 @@ static VALUE unpack_utf8(VALUE self) >+ return rb_funcall(self, unpack_id, 1, U_fmt); >+ } >+ >+-static VALUE unpack_uchar(VALUE self) >++static VALUE unpack_uchar(VALUE self, VALUE exc) >+ { >+ return rb_funcall(self, unpack_id, 1, C_fmt); >+ } >diff --git a/www/rubygem-hpricot/files/patch-ext_hpricot__scan_hpricot__scan.c b/www/rubygem-hpricot/files/patch-ext_hpricot__scan_hpricot__scan.c >new file mode 100644 >index 000000000000..1ff2c93e270f >--- /dev/null >+++ b/www/rubygem-hpricot/files/patch-ext_hpricot__scan_hpricot__scan.c >@@ -0,0 +1,11 @@ >+--- ext/hpricot_scan/hpricot_scan.c.orig 2023-05-04 18:05:46 UTC >++++ ext/hpricot_scan/hpricot_scan.c >+@@ -22,7 +22,7 @@ struct hpricot_struct { >+ #define RSTRING_PTR(str) RSTRING(str)->ptr >+ #endif >+ >+-VALUE hpricot_css(VALUE, VALUE, VALUE, VALUE, VALUE); >++VALUE hpricot_css(VALUE, VALUE, VALUE, VALUE); >+ >+ #define NO_WAY_SERIOUSLY "*** This should not happen, please file a bug report with the HTML you're parsing at http://github.com/hpricot/hpricot/issues. So sorry!" >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 271245
: 241978