Project

General

Profile

Actions

Misc #8646

closed

Can't compile ruby on AIX using gcc if a function name has $.

Added by kanemoto (Yutaka Kanemoto) over 10 years ago. Updated about 10 years ago.


Description

r41273で追加されたSafe Levelのチェックの部分で関数名に $ が使われているのですが、AIXのgccでエラーになってしまいます。

% make
(中略)
compiling ../trunk/main.c
In file included from ../trunk/include/ruby.h:33:0,
from ../trunk/main.c:13:
../trunk/include/ruby/ruby.h:570:1: error: stray '$' in program
int ruby$safe_level$4(void) attribute((error("$SAFE=4 is obsolete")));
^
../trunk/include/ruby/ruby.h:570:10: error: expected '=', ',', ';', 'asm' or 'attribute' before 'safe_level'
int ruby$safe_level$4(void) attribute((error("$SAFE=4 is obsolete")));
^
../trunk/include/ruby/ruby.h:570:10: error: stray '$' in program
make: *** [main.o] Error 1

ここをみると、
http://gcc.gnu.org/onlinedocs/gcc/Interoperation.html
最後の行に説明があります。
実際最近のバージョンのgccだと-fdollars-in-identifiersを使うとエラーがなくなるのですが、
先日いくつかAIXに関する報告をしてくれた方(GCCのCompilationFarmを紹介してくれました)に聞いてみると、

If Ruby starts using it in general, there would be problems on AIX and
it would be a bad portability decision by Ruby community.

とのことです。というわけで、2箇所ある ruby$safe_level$4 の $ (合計4つ)を _ あたりに変更させていただいてもよろしいでしょうか?
もしそれでよければこちらでコミットしますのでご一報下さい。
よろしくお願いいたします。

Updated by nobu (Nobuyoshi Nakada) over 10 years ago

  • Status changed from Open to Assigned
  • Assignee changed from nobu (Nobuyoshi Nakada) to kanemoto (Yutaka Kanemoto)

どうぞ。

Updated by nobu (Nobuyoshi Nakada) about 10 years ago

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

Also available in: Atom PDF

Like0
Like0Like0