Actions
Bug #846
closedthread.c:2981: warning: format not a string literal and no format arguments
Description
=begin
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;
}
=end
Actions
Like0
Like0