Bug #7247

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

Added by Naohisa Goto over 2 years ago. Updated over 2 years ago.

[ruby-dev:46322]
Status:Closed
Priority:Normal
Assignee:-
ruby -v:- Backport:

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

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

Associated revisions

Revision 37402
Added by Nobuyoshi Nakada over 2 years ago

thread_pthread.c: RUBY_STACK_MIN

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

Revision 37402
Added by Nobuyoshi Nakada over 2 years ago

thread_pthread.c: RUBY_STACK_MIN

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

History

#1 Updated by Nobuyoshi Nakada over 2 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. [Bug #7247]

#2 Updated by Naohisa Goto about 1 year ago

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

Also available in: Atom PDF