Skip to content

ruby 3.0.6 compilation error on MacOS Sonoma 14 related to maybe_unused #288

@amkisko

Description

@amkisko

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/openssl@1.1 --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: rbenv/ruby-build#2185 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions