bigdecimal icon indicating copy to clipboard operation
bigdecimal copied to clipboard

ruby 3.0.6 compilation error on MacOS Sonoma 14 related to maybe_unused

Open amkisko opened this issue 1 year ago • 0 comments

I was trying to install ruby 3.0.6 on Sonoma 14.3.1 using rbenv:

ruby-build: using readline from homebrew
ruby-build: using libyaml from homebrew
ruby-build: using gmp from homebrew
-> ./configure "--prefix=$HOME/.rbenv/versions/3.0.6" --with-openssl-dir=/usr/local/opt/[email protected] --with-readline-dir=/usr/local/opt/readline --with-libyaml-dir=/usr/local/opt/libyaml --with-gmp-dir=/usr/local/opt/gmp --with-ext=openssl,psych,+ --disable-shared
-> make -j 16

BUILD FAILED (macOS 14.3.1 on x86_64 using ruby-build 20231225)

---

bigdecimal.c:249:5: error: 'maybe_unused' attribute cannot be applied to types
  249 |     ENTER(1);
      |     ^
bigdecimal.c:68:33: note: expanded from macro 'ENTER'
   68 | #define ENTER(n) volatile VALUE RB_UNUSED_VAR(vStack[n]);int iStack=0
      |                                 ^
../.././include/ruby/backward/2/attributes.h:168:28: note: expanded from macro 'RB_UNUSED_VAR'
  168 | #define RB_UNUSED_VAR(x) x RBIMPL_ATTR_MAYBE_UNUSED()
      |                            ^
../.././include/ruby/internal/attr/maybe_unused.h:31:39: note: expanded from macro 'RBIMPL_ATTR_MAYBE_UNUSED'
   31 | # define RBIMPL_ATTR_MAYBE_UNUSED() [[maybe_unused]]
      |                                       ^
bigdecimal.c:372:5: error: 'maybe_unused' attribute cannot be applied to types
  372 |     ENTER(1);
      |     ^

Does anybody have suggestions how to fix these?

Duplicate post here: https://github.com/rbenv/ruby-build/discussions/2185#discussioncomment-8532328

amkisko avatar Feb 21 '24 10:02 amkisko