ruby-changes:33373
From: nobu <ko1@a...>
Date: Thu, 27 Mar 2014 21:03:41 +0900 (JST)
Subject: [ruby-changes:33373] nobu:r45452 (trunk): string.c: suppress warnings
nobu 2014-03-27 21:03:36 +0900 (Thu, 27 Mar 2014) New Revision: 45452 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45452 Log: string.c: suppress warnings * string.c (rb_str_sub_bang, str_gsub): initialize conditionally assigned variables to suppress maybe-uninitialized warnings. Modified files: trunk/string.c Index: string.c =================================================================== --- string.c (revision 45451) +++ string.c (revision 45452) @@ -3947,7 +3947,7 @@ rb_str_sub_bang(int argc, VALUE *argv, V https://github.com/ruby/ruby/blob/trunk/string.c#L3947 rb_encoding *enc; int cr = ENC_CODERANGE(str); long beg0, end0; - VALUE match, match0; + VALUE match, match0 = Qnil; struct re_registers *regs; char *p, *rp; long len, rlen; @@ -4076,7 +4076,7 @@ rb_str_sub(int argc, VALUE *argv, VALUE https://github.com/ruby/ruby/blob/trunk/string.c#L4076 static VALUE str_gsub(int argc, VALUE *argv, VALUE str, int bang) { - VALUE pat, val, repl, match, match0, dest, hash = Qnil; + VALUE pat, val = Qnil, repl, match, match0 = Qnil, dest, hash = Qnil; struct re_registers *regs; long beg, n; long beg0, end0; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/