From: shyouhei@... Date: 2016-09-18T10:40:03+00:00 Subject: [ruby-dev:49814] [Ruby trunk Bug#12767] Since r56169, compile error of vsnprintf.c with Oracle Solaris Studio 12.x Issue #12767 has been updated by Shyouhei Urabe. これは完全に考慮漏れでした。ごめんなさい。 ---------------------------------------- Bug #12767: Since r56169, compile error of vsnprintf.c with Oracle Solaris Studio 12.x https://bugs.ruby-lang.org/issues/12767#change-60541 * Author: Naohisa Goto * Status: Closed * Priority: Normal * Assignee: * ruby -v: * Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- おそらく r56169以降、Solaris 10 上の Oracle Solaris Studio 12.3 では、以下のコンパイルエラーでビルドに失敗します。 ``` cc -errtags=yes -xO4 -xtarget=sparc64viiplus -m64 -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/9.0.0 -o sprintf.o -c sprintf.c "vsnprintf.c", line 561: warning: function prototype parameters must have types (E_FUNC_PROTO_REQ_TYPES) "vsnprintf.c", line 837: undefined symbol: ulval "vsnprintf.c", line 862: undefined symbol: ulval "vsnprintf.c", line 980: undefined symbol: ulval cc: acomp failed for sprintf.c make: *** [sprintf.o] Error 2 ``` 561行目は以下のように ulval を定義しているはずの行ですが、Warningのとおり、関数プロトタイプと見なされてしまっています。 そして、ulval が出現する832行目などで、未定義というエラーが出ています。 ``` u_long MAYBE_UNUSED(ulval); /* integer arguments %[diouxX] */ ``` ./configure 時の MAYBE_UNUSEDなどの結果は以下の通りです。 ``` checking for WARN_UNUSED_RESULT function attribute... x checking for MAYBE_UNUSED function attribute... x ``` そして、config.h には WARN_UNUSED_RESULT および MAYBE_UNUSED の定義の行は存在しません。 これは、FUNC_STDCALL など x になっている他の function attribute についても同様で、 configure の仕様の気がします。 このため、internal.h には MAYBE_UNUSED (および WARN_UNUSED_RESULT)の代替実装が必要ですが、r56169 で削除されてしまっています。 -- https://bugs.ruby-lang.org/