Project

General

Profile

Bug #5464

compile error in vm_eval.c

Added by ngoto (Naohisa Goto) over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
ruby 2.0.0dev (2011-10-19) [sparc-solaris2.10]
Backport:
[ruby-dev:44632]

Description

Solaris 10 にて Fujitsu C Compiler Version 5.6 を使ってtrunkをコンパイルしたところ、以下のコンパイルエラーが出ました。

"./vm_eval.c", line 275: error: initialization: constant expression is expected for variable: `args'

このコンパイラでは、Cの配列の初期値としてコンパイル時に確定するものしか使えないようです。
1要素ずつ代入するようにするパッチを添付します。他の環境でも問題ないと思います。

--- vm_eval.c (revision 33484)
+++ vm_eval.c (working copy)
@@ -272,7 +272,10 @@

 me = rb_method_entry(klass, idRespond_to);
 if (me && !(me->flag & NOEX_BASIC)) {
  • VALUE args[2] = {ID2SYM(mid), Qtrue};
  • VALUE args[2]; +
  • args[0] = ID2SYM(mid);
  • args[1] = Qtrue; if (!RTEST(vm_call0(th, recv, idRespond_to, 2, args, me))) { return Qundef; }

Files

20111020-vm_eval-c-build.patch (465 Bytes) 20111020-vm_eval-c-build.patch ngoto (Naohisa Goto), 10/20/2011 12:06 PM

Associated revisions

Revision 67db3f81
Added by ngoto (Naohisa Goto) over 7 years ago

  • ChangeLog: forgot [Bug #5464] [ruby-dev:44632] for the previous commit

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 33494
Added by ngoto (Naohisa Goto) over 7 years ago

  • ChangeLog: forgot [Bug #5464] [ruby-dev:44632] for the previous commit

Revision 33494
Added by ngoto (Naohisa Goto) over 7 years ago

  • ChangeLog: forgot [Bug #5464] [ruby-dev:44632] for the previous commit

Revision 33494
Added by ngoto (Naohisa Goto) over 7 years ago

  • ChangeLog: forgot [Bug #5464] [ruby-dev:44632] for the previous commit

Revision 33494
Added by ngoto (Naohisa Goto) over 7 years ago

  • ChangeLog: forgot [Bug #5464] [ruby-dev:44632] for the previous commit

Revision 33494
Added by ngoto (Naohisa Goto) over 7 years ago

  • ChangeLog: forgot [Bug #5464] [ruby-dev:44632] for the previous commit

Revision 33494
Added by ngoto (Naohisa Goto) over 7 years ago

  • ChangeLog: forgot [Bug #5464] [ruby-dev:44632] for the previous commit

History

Updated by nobu (Nobuyoshi Nakada) over 7 years ago

  • Category set to core
  • Status changed from Open to Assigned
  • Assignee set to ngoto (Naohisa Goto)
  • Target version set to Next Major
#2

Updated by ngoto (Naohisa Goto) over 7 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r33494.
Naohisa, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • ChangeLog: forgot [Bug #5464] [ruby-dev:44632] for the previous commit

Also available in: Atom PDF