Project

General

Profile

Actions

Bug #5464

closed

compile error in vm_eval.c

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

Status:
Closed
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

Updated by nobu (Nobuyoshi Nakada) over 12 years ago

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

Updated by ngoto (Naohisa Goto) over 12 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.


Actions

Also available in: Atom PDF

Like0
Like0Like0