Bug #7247

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

Added by Naohisa Goto over 1 year ago. Updated over 1 year ago.

[ruby-dev:46322]
Status:Closed
Priority:Normal
Assignee:-
Category:-
Target version:2.0.0
ruby -v:- Backport:

Description

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

cc -O -xtarget=sparc64viiplus -m64 -DRUBYEXPORT -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 PTHREADSTACKMIN
RUBYSTACKMIN = ((RUBYSTACKMINLIMIT < PTHREADSTACKMIN) ?
PTHREAD
STACKMIN * 2 : RUBYSTACKMINLIMIT),

Solaris10では、PTHREADSTACKMIN は /usr/include/limits.h にて以下のように定義されています。
#define PTHREADSTACKMIN ((sizet)sysconf(SCTHREADSTACKMIN))

つまり、PTHREADSTACKMINの実体は関数であり、定数ではありません。このため、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 1 year ago

threadpthread.c: RUBYSTACK_MIN

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

History

#1 Updated by Nobuyoshi Nakada over 1 year 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.


threadpthread.c: RUBYSTACK_MIN

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

#2 Updated by Naohisa Goto 3 months ago

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

Also available in: Atom PDF