Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 04 May 2023 18:18:48 +0000
From:      bugzilla-noreply@freebsd.org
To:        ruby@FreeBSD.org
Subject:   [Bug 271245] www/rubygem-hpricot: fix build with clang 16
Message-ID:  <bug-271245-21402@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271245

            Bug ID: 271245
           Summary: www/rubygem-hpricot: fix build with clang 16
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: ruby@FreeBSD.org
          Reporter: dim@FreeBSD.org
          Assignee: ruby@FreeBSD.org
             Flags: maintainer-feedback?(ruby@FreeBSD.org)

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 'VAL=
UE
(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 =3D 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)(VALU=
E,
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 con=
tain
an exception to be handled).

Another similar error occurs later in hpricot_scan.c, which was generated f=
rom
hpricot_scan.rl:

  hpricot_scan.rl:855:3: error: incompatible function pointer types passing
'VALUE (VALUE, VALUE, VALUE, VALUE, VALUE)' (aka 'unsigned long (unsigned l=
ong,
unsigned long, unsigned long, unsigned long, unsigned long)') to parameter =
of
type 'VALUE (*)(VALUE, VALUE, VALUE, VALUE)' (aka 'unsigned long (*)(unsign=
ed
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: expand=
ed
from macro 'rb_define_singleton_method'
  #define rb_define_singleton_method(obj, mid, func, arity)=20=20
RBIMPL_ANYARGS_DISPATCH_rb_define_singleton_method((arity), (func))((obj),
(mid), (func), (arity))
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20
                                                                ^~~~~~
  /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 b=
e a
pointer to a function taking four VALUE parameters, not five.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



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