Closed thesamesam closed 1 year ago
Clang 16 makes -Wincompatible-function-pointer-types an error by default.
-Wincompatible-function-pointer-types
ruby-gpgme hits the following failure when building with Clang 16:
[...] gpgme_n.c:2422:3: error: incompatible function pointer types passing 'VALUE (VALUE, VALUE, VALUE, VALUE)' (aka 'unsigned long (unsigned long, unsigned long, unsigned long, unsigned long)') to parameter of type 'VALUE (*)(VALUE, VALUE, VALUE, VALUE, VALUE)' (aka 'unsigned long (*)(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long)') [-Werror,-Wincompatible-function-pointer-types] rb_define_module_function (mGPGME, "gpgme_op_keylist_ext_start", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/ruby-2.7.0/ruby/ruby.h:2827:135: note: expanded from macro 'rb_define_module_function' ...(func),(arity)); ^~~~~~ /usr/include/ruby-2.7.0/ruby/ruby.h:2804:1: note: passing argument to parameter 'func' here RB_METHOD_DEFINITION_DECL(rb_define_module_function, (2,3), (VALUE klass... ^ /usr/include/ruby-2.7.0/ruby/intern.h:1077:89: note: expanded from macro 'RB_METHOD_DEFINITION_DECL' ...,3 ,decl,vars,(VALUE,VALUE,VALUE,VALUE)) \ ^ /usr/include/ruby-2.7.0/ruby/intern.h:1069:5: note: expanded from macro '\ RB_METHOD_DEFINITION_DECL_1' RB_METHOD_DEFINITION_DECL_C(def,nonnull,defname,decl,vars,funcargs) \ ^ /usr/include/ruby-2.7.0/ruby/intern.h:1042:118: note: expanded from macro 'RB_METHOD_DEFINITION_DECL_C' ...nonnull))static void defname(RB_UNWRAP_MACRO decl,VALUE(*func)funcargs,i... ^ 4 warnings and 1 error generated. make: *** [Makefile:245: gpgme_n.o] Error 1
To reproduce this bug:
-Werror=incompatible-function-pointer-types
-Werror=incompatible-pointer-types
Reported downstream in Gentoo at https://bugs.gentoo.org/881203.
I just ran into this issue on M1, is there any workarounds for this?
Should be fixed with #176 (thanks @thukim). Feel free to reopen if the problem still persists.
Clang 16 makes
-Wincompatible-function-pointer-types
an error by default.ruby-gpgme hits the following failure when building with Clang 16:
To reproduce this bug:
-Werror=incompatible-function-pointer-types
-Werror=incompatible-pointer-types
(GCC lacks a more specific warning)Reported downstream in Gentoo at https://bugs.gentoo.org/881203.