# \[Bug #846\] thread.c:2981: warning: format not a string literal and no format arguments

**URL:** <https://www.ruby-forum.com/t/bug-846-thread-c-warning-format-not-a-string-literal-and-no-format-arguments/155305>\
**Category:** Development\
**Created:** [December 10, 2008, 12:50pm UTC](https://www.ruby-forum.com/t/bug-846-thread-c-warning-format-not-a-string-literal-and-no-format-arguments/155305 "2008-12-10T12:50:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kazuhiro\_NISHIYAMA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/77aa72/32.png) [@Kazuhiro\_NISHIYAMA](https://www.ruby-forum.com/u/Kazuhiro_NISHIYAMA)\
**Post date:** [December 10, 2008, 12:50pm UTC](https://www.ruby-forum.com/t/bug-846-thread-c-warning-format-not-a-string-literal-and-no-format-arguments/155305/1 "2008-12-10T12:50:59Z")

</div>

Bug #846: thread.c:2981: warning: format not a string literal and no  
format arguments  
[http://redmine.ruby-lang.org/issues/show/846](http://redmine.ruby-lang.org/issues/show/846)

e$B5/I\<\<Te(B: Kazuhiro NISHIYAMA  
e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Low

[http://www.rubyist.net/~akr/chkbuild/debian/ruby-trunk/last](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

e$B$H$$$&7Y9p$,=P$F$$$^$9!#e(B  
mutex\_unlocke$B$Oe(B%e$B$r4^$^$J$$8GDj$NJ8;zNs$rJV$7$F$$$k$N$G!":#$N$H$3$mLdBj$Oe(B  
e$B$J$5$=$&$K8+$($^$9$,!"0J2\<$N$h$&$K$7$?J}$,$h$$$N$G$O$J$$$G$7$g$&$+e(B?

# 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);

---

<div class="post-metadata">

**Author:** ![Kazuhiro\_NISHIYAMA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/77aa72/32.png) [@Kazuhiro\_NISHIYAMA](https://www.ruby-forum.com/u/Kazuhiro_NISHIYAMA)\
**Post date:** [December 10, 2008, 5:38pm UTC](https://www.ruby-forum.com/t/bug-846-thread-c-warning-format-not-a-string-literal-and-no-format-arguments/155305/2 "2008-12-10T17:38:05Z")

</div>

e$B%A%1%C%He(B #846 e$B$,99?7$5$l$^$7$?!#e(B (by Yukihiro M.)

e$B%9%F!\<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B  
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

## Applied in changeset r20615.

[http://redmine.ruby-lang.org/issues/show/846](http://redmine.ruby-lang.org/issues/show/846)
