ruby-xslt icon indicating copy to clipboard operation
ruby-xslt copied to clipboard

Build failure with Clang 16 (`-Wincompatible-function-pointer-types`)

Open thesamesam opened this issue 2 years ago • 1 comments

Clang 16 makes -Wincompatible-function-pointer-types an error by default.

ruby-xslt hits the following failure when building with Clang 16:

[...]
xslt_lib.c:437:46: error: incompatible function pointer types passing 'VALUE (VALUE, VALUE)' (aka 'unsigned long (unsigned long, unsigned long)') to parameter of type 'rb_block_call_func_t' (aka 'unsigned long (*)(unsigned long, unsigned long, int, const unsigned long *, unsigned long)') [-Werror,-Wincompatible-function-pointer-types]
    (void)rb_iterate( each_pair, parameters, process_pair, pRbTxslt->pxParams );
                                             ^~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/ruby.h:1986:60: note: passing argument to parameter here
VALUE rb_iterate(VALUE(*)(VALUE),VALUE,rb_block_call_func_t,VALUE);
                                                           ^
1 warning and 1 error generated.
make: *** [Makefile:245: xslt_lib.o] Error 1

To reproduce this bug:

  • with Clang 16, just build normally
  • with Clang 15, pass -Werror=incompatible-function-pointer-types
  • with GCC, pass -Werror=incompatible-pointer-types (GCC lacks a more specific warning)

Reported downstream in Gentoo at https://bugs.gentoo.org/884407. Full log at https://bugs.gentoo.org/attachment.cgi?id=840185.

thesamesam avatar Feb 24 '23 16:02 thesamesam

I keep getting the same error. Did you manage to get around it somehow @thesamesam?

Wiechsaa avatar Aug 03 '24 19:08 Wiechsaa