From: Kazuhiro NISHIYAMA Date: 2008-12-10T20:43:45+09:00 Subject: [ruby-dev:37345] [Bug #846] thread.c:2981: warning: format not a string literal and no format arguments Bug #846: thread.c:2981: warning: format not a string literal and no format arguments http://redmine.ruby-lang.org/issues/show/846 起票者: Kazuhiro NISHIYAMA ステータス: Open, 優先度: Low http://www.rubyist.net/~akr/chkbuild/debian/ruby-trunk/last gcc -DRUBY_DEBUG_ENV -O2 -g -Wall -Wformat=2 -Wundef -Wno-parentheses -I. -I.ext/include/i686-linux -I./include -I. -DRUBY_EXPORT -o thread.o -c thread.c thread.c: In function 'rb_mutex_unlock': thread.c:2981: warning: format not a string literal and no format arguments という警告が出ています。 mutex_unlockは%を含まない固定の文字列を返しているので、今のところ問題は なさそうに見えますが、以下のようにした方がよいのではないでしょうか? Index: thread.c =================================================================== --- thread.c (revision 20609) +++ thread.c (working copy) @@ -2978,7 +2978,7 @@ rb_mutex_unlock(VALUE self) GetMutexPtr(self, mutex); err = mutex_unlock(mutex); - if (err) rb_raise(rb_eThreadError, err); + if (err) rb_raise(rb_eThreadError, "%s", err); return self; } ---------------------------------------- http://redmine.ruby-lang.org