Project

General

Profile

Bug #12768

Since r56158, compile error in "hash.c", line 1753, with old fcc on Solaris 10

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

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-dev:49808]

Description

おそらく r56158 以降、Solaris 10上の古い Fujitsu C Compiler (fcc) にて、以下のコンパイルエラーが発生します。

fcc -O2 -KV9 -KVIS2  -DRUBY_EXPORT -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include  -D_XOPEN_SOURCE=500   -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -I./enc/unicode/9.0.0 -o hash.o -c hash.c
(warningは省略)
"hash.c", line 1753: error: initialization: constant expression is expected for variable: `argv'
(warningは省略)
make: *** [hash.o] Error 1

以下のように1個ずつ代入するようにしたら、コンパイルが通るようになりました。
今時のコンパイラなら、最適化が効くので、このように書いても速度やコードサイズは元と変わらないと思います、多分。

===================================================================
--- hash.c      (revision 56170)
+++ hash.c      (working copy)
@@ -1750,7 +1750,9 @@
 static int
 each_pair_i_fast(VALUE key, VALUE value)
 {
-    VALUE argv[2] = {key, value};
+    VALUE argv[2];
+    argv[0] = key;
+    argv[1] = value;
     rb_yield_values2(2, argv);
     return ST_CONTINUE;
 }

Associated revisions

Revision c1dbcf9b
Added by ngoto (Naohisa Goto) over 2 years ago

  • hash.c (each_pair_i_fast): Fix compile error with old version of fcc on Solaris 10. [Bug #12768] [ruby-dev:49808]

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

Revision 56171
Added by ngoto (Naohisa Goto) over 2 years ago

  • hash.c (each_pair_i_fast): Fix compile error with old version of fcc on Solaris 10. [Bug #12768] [ruby-dev:49808]

Revision 56171
Added by ngoto (Naohisa Goto) over 2 years ago

  • hash.c (each_pair_i_fast): Fix compile error with old version of fcc on Solaris 10. [Bug #12768] [ruby-dev:49808]

Revision 56171
Added by ngoto (Naohisa Goto) over 2 years ago

  • hash.c (each_pair_i_fast): Fix compile error with old version of fcc on Solaris 10. [Bug #12768] [ruby-dev:49808]

Revision 56171
Added by ngoto (Naohisa Goto) over 2 years ago

  • hash.c (each_pair_i_fast): Fix compile error with old version of fcc on Solaris 10. [Bug #12768] [ruby-dev:49808]

History

#1

Updated by ngoto (Naohisa Goto) over 2 years ago

  • Status changed from Open to Closed

Applied in changeset r56171.


  • hash.c (each_pair_i_fast): Fix compile error with old version of fcc on Solaris 10. [Bug #12768] [ruby-dev:49808]

Also available in: Atom PDF