Project

General

Profile

Actions

Bug #7247

closed

r37079以降Solaris10でthread_pthread.cがコンパイルエラー

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

Status:
Closed
Assignee:
-
Target version:
ruby -v:
-
Backport:
[ruby-dev:46322]

Description

r37079以降、Solaris10のccでは以下のエラーが出て失敗します。(以下はr37390にて確認)

cc -O -xtarget=sparc64viiplus -m64 -DRUBY_EXPORT -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -o thread.o -c thread.c
"thread_pthread.c", line 600: non-constant enumerator value

thread_pthread.cの600行め付近は以下のようになっています。

enum {
(中略)
#ifdef PTHREAD_STACK_MIN
RUBY_STACK_MIN = ((RUBY_STACK_MIN_LIMIT < PTHREAD_STACK_MIN) ?
PTHREAD_STACK_MIN * 2 : RUBY_STACK_MIN_LIMIT),

Solaris10では、PTHREAD_STACK_MIN は /usr/include/limits.h にて以下のように定義されています。
#define PTHREAD_STACK_MIN ((size_t)_sysconf(_SC_THREAD_STACK_MIN))

つまり、PTHREAD_STACK_MINの実体は関数であり、定数ではありません。このため、enumの中に定数ではない数を書いているというコンパイルエラーになりました。


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #9436: r44670以降Solaris10でthread_pthread.cがコンパイルエラーClosed01/21/2014Actions
Actions #1

Updated by nobu (Nobuyoshi Nakada) about 12 years ago

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

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


thread_pthread.c: RUBY_STACK_MIN

  • thread_pthread.c (RUBY_STACK_MIN): may not a compile time constant.
    fix r37079. [ruby-dev:46322] [Bug #7247]

Updated by ngoto (Naohisa Goto) almost 11 years ago

  • Related to Bug #9436: r44670以降Solaris10でthread_pthread.cがコンパイルエラー added
Actions

Also available in: Atom PDF

Like0
Like0Like0