iconv icon indicating copy to clipboard operation
iconv copied to clipboard

Fails to build on ruby 3.3 with clang-1500.3.9.4

Open joeljunstrom opened this issue 1 year ago • 2 comments

Given the last command line tools update on MacOS with a M1 iconv no longer builds.

Excerpt from the log:

iconv.c:709:50: 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)') [-Wincompatible-function-pointer-types]
        rb_block_call(options, rb_intern("each"), 0, 0, get_iconv_opt_i, (VALUE)opt);

It does compile with gem install iconv -- --with-cflags="-Wno-incompatible-function-pointer-types"

joeljunstrom avatar Mar 07 '24 09:03 joeljunstrom

I can confirm it happened with an intel mac using clang-1500.3.9.4, could install using

gem install iconv -- --with-cflags="-Wno-incompatible-function-pointer-types" as @joeljunstrom mentioned. Thanks!

Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: x86_64-apple-darwin23.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

fabiode avatar May 29 '24 10:05 fabiode

I can confirm it happened with an intel mac using clang-1500.3.9.4, could install using

gem install iconv -- --with-cflags="-Wno-incompatible-function-pointer-types" as @joeljunstrom mentioned. Thanks!

Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: x86_64-apple-darwin23.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

encountered the same problem on my mac M2 chip, and this solution works! thanks!

ameeraazli avatar Jul 09 '24 06:07 ameeraazli