Project

General

Profile

Actions

Bug #846

closed

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

Added by znz (Kazuhiro NISHIYAMA) over 15 years ago. Updated almost 13 years ago.

Status:
Closed
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

Actions #1

Updated by matz (Yukihiro Matsumoto) over 15 years ago

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

=begin
Applied in changeset r20615.
=end

Actions

Also available in: Atom PDF

Like0
Like0