Project

General

Profile

Bug #846

thread.c:2981: warning: format not a string literal and no format arguments

Added by znz (Kazuhiro NISHIYAMA) over 10 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
Backport:
[ruby-dev:37345]

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

Associated revisions

Revision bd4d9e9a
Added by matz (Yukihiro Matsumoto) over 10 years ago

  • thread.c (rb_mutex_unlock): shut up warning. a patch from Kazuhiro NISHIYAMA in [ruby-dev:37345]. fix #846

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 20615
Added by matz (Yukihiro Matsumoto) over 10 years ago

  • thread.c (rb_mutex_unlock): shut up warning. a patch from Kazuhiro NISHIYAMA in [ruby-dev:37345]. fix #846

Revision 20615
Added by matz (Yukihiro Matsumoto) over 10 years ago

  • thread.c (rb_mutex_unlock): shut up warning. a patch from Kazuhiro NISHIYAMA in [ruby-dev:37345]. fix #846

Revision 20615
Added by matz (Yukihiro Matsumoto) over 10 years ago

  • thread.c (rb_mutex_unlock): shut up warning. a patch from Kazuhiro NISHIYAMA in [ruby-dev:37345]. fix #846

Revision 20615
Added by matz (Yukihiro Matsumoto) over 10 years ago

  • thread.c (rb_mutex_unlock): shut up warning. a patch from Kazuhiro NISHIYAMA in [ruby-dev:37345]. fix #846

Revision 20615
Added by matz (Yukihiro Matsumoto) over 10 years ago

  • thread.c (rb_mutex_unlock): shut up warning. a patch from Kazuhiro NISHIYAMA in [ruby-dev:37345]. fix #846

Revision 20615
Added by matz (Yukihiro Matsumoto) over 10 years ago

  • thread.c (rb_mutex_unlock): shut up warning. a patch from Kazuhiro NISHIYAMA in [ruby-dev:37345]. fix #846

Revision f96cd536
Added by yugui (Yuki Sonoda) over 10 years ago

merges r20615 from trunk into ruby_1_9_1.

  • thread.c (rb_mutex_unlock): shut up warning. a patch from Kazuhiro NISHIYAMA in [ruby-dev:37345]. fix #846

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@20693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

History

#1

Updated by matz (Yukihiro Matsumoto) over 10 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r20615.
=end

Also available in: Atom PDF