[#37248] [Feature:1.9] Enumerator#inspect — "Yusuke ENDOH" <mame@...>

遠藤です。

12 messages 2008/12/02

[#37337] [Feature #841] Object#self — "rubikitch ." <redmine@...>

Feature #841: Object#self

13 messages 2008/12/09

[#37513] Current status of 1.9.1 RC1's issues — "Yugui (Yuki Sonoda)" <yugui@...>

Hi, folks

14 messages 2008/12/20
[#37516] Re: Current status of 1.9.1 RC1's issues — Masatoshi SEKI <m_seki@...> 2008/12/20

咳といいます。

[#37576] [BUG:trunk] encoding for stdio's — "Yugui (Yuki Sonoda)" <yugui@...>

Yuguiです。

11 messages 2008/12/24

[ruby-dev:37345] [Bug #846] thread.c:2981: warning: format not a string literal and no format arguments

From: Kazuhiro NISHIYAMA <redmine@...>
Date: 2008-12-10 11:43:45 UTC
List: ruby-dev #37345
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

In This Thread

Prev Next