Project

General

Profile

Actions

Bug #12701

closed

compile error about ALWAYS_INLINE

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

Status:
Closed
Assignee:
-
Target version:
-
[ruby-dev:49773]

Description

遅くとも r55884 以降、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/8.0.0 -o vm.o -c vm.c
(中略)
"./vm_insnhelper.c", line 864: error: invalid storage class specifier `static' specified for `vm_getivar' at parameter scope
"./vm_insnhelper.c", line 864: warning: external declaration has no declaration specifier
(中略)
make: *** [vm.o] Error 1

ALWAYS_INLINE 未定義時の代替実装が欠けていたのが原因で、以下のパッチで治りました。

--- include/ruby/defines.h      (revision 55996)
+++ include/ruby/defines.h      (working copy)
@@ -45,6 +45,9 @@
 #ifndef NOINLINE
 # define NOINLINE(x) x
 #endif
+#ifndef ALWAYS_INLINE
+# define ALWAYS_INLINE(x) x
+#endif
 #ifndef ERRORFUNC
 # define HAVE_ATTRIBUTE_ERRORFUNC 0
 # define ERRORFUNC(mesg, x) x

逆に、以前どうしてコンパイルが通っていたのか不思議なくらいです。どうやら、偶然にも、文法的にエラーにならない範囲内だったようです。
r55884 では、それ以前に ALWAYS_INLINE を使っていた所と異なり、プロトタイプ宣言が引数の名前を含めず型だけを宣言するスタイルだったため、いよいよ破綻してエラーになったということのようです。

Actions

Also available in: Atom PDF

Like0
Like0