Compilation issue dtoa.c - missing binary operator before token

未关闭
#569 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
c, ruby
领域
build-system

调研方向

Start by reproducing the failure with the Docker command in the issue, then inspect the preprocessor condition around line 214 of missing/dtoa.c, included from missing.c. Check how the condition behaves with the reported compiler and Ruby 3.0.6. Done means the gem builds and loads successfully in that environment.

由索引模型根据 Issue 内容生成。

描述

Hi there; We're just trying to compile the latest release of this gem and hitting an issue:

missing/dtoa.c:214:20: error: missing binary operator before token "("

Replication command:

docker run --rm --user jenkins --env HOME=/home/jenkins rapid7/msf-ubuntu1204-x86-omnibus:2024_04 linux32 bash -lc 'mkdir -p "$HOME/.local/share/gem/ruby/3.0.0/cache" && source /home/jenkins/.rvm/scripts/rvm && rvm use 3.0.6 && gem install bigdecimal -v 4.1.3 --platform ruby --no-document && ruby -rbigdecimal -e '\''abort unless BigDecimal::VERSION == %q(4.1.3) && BigDecimal(%q(1.25)) + BigDecimal(%q(2.75)) == 4; puts %Q(bigdecimal #{BigDecimal::VERSION}: compiled and loaded)'\'''

Error:

Using /home/jenkins/.rvm/gems/ruby-3.0.6
Building native extensions. This could take a while...
ERROR:  Error installing bigdecimal:
	ERROR: Failed to build gem native extension.

    current directory: /home/jenkins/.rvm/gems/ruby-3.0.6/gems/bigdecimal-4.1.3/ext/bigdecimal
/home/jenkins/.rvm/rubies/ruby-3.0.6/bin/ruby -I /home/jenkins/.rvm/rubies/ruby-3.0.6/lib/ruby/3.0.0 -r ./siteconf20261103-186-cilydo.rb extconf.rb
checking for __builtin_clz()... yes
checking for __builtin_clzl()... yes
checking for __builtin_clzll()... yes
checking for float.h... yes
checking for math.h... yes
checking for stdbool.h... yes
checking for stdlib.h... yes
checking for x86intrin.h... yes
checking for _lzcnt_u32() in x86intrin.h... no
checking for _lzcnt_u64() in x86intrin.h... no
checking for intrin.h... no
checking for ruby/atomic.h... yes
checking for ruby/internal/has/builtin.h... yes
checking for ruby/internal/static_assert.h... yes
checking for rb_complex_real() in ruby.h... yes
checking for rb_complex_imag() in ruby.h... yes
checking for rb_opts_exception_p() in ruby.h... yes
checking for rb_category_warn() in ruby.h... yes
checking for RB_WARN_CATEGORY_DEPRECATED in ruby.h... yes
checking for RUBY_TYPED_EMBEDDABLE in ruby.h... no
creating Makefile

current directory: /home/jenkins/.rvm/gems/ruby-3.0.6/gems/bigdecimal-4.1.3/ext/bigdecimal
make DESTDIR\= clean

current directory: /home/jenkins/.rvm/gems/ruby-3.0.6/gems/bigdecimal-4.1.3/ext/bigdecimal
make DESTDIR\=
compiling bigdecimal.c
compiling missing.c
In file included from missing.c:28:0:
missing/dtoa.c:214:20: error: missing binary operator before token "("
cc1: warning: unrecognized command line option "-Wno-tautological-compare" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-self-assign" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-parentheses-equality" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-constant-logical-operand" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-cast-function-type" [enabled by default]
make: *** [missing.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/jenkins/.rvm/gems/ruby-3.0.6/gems/bigdecimal-4.1.3 for inspection.
Results logged to /home/jenkins/.rvm/gems/ruby-3.0.6/extensions/x86-linux/3.0.0/bigdecimal-4.1.3/gem_make.out
主要语言
C
星标
152
派生
99
平均合并
6 小时 44 分钟
30 天内合并 PR
2

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ruby/bigdecimal 的其他 Issue

查看 ruby/bigdecimal 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。