[前][次][番号順一覧][スレッド一覧]

ruby-changes:42969

From: nobu <ko1@a...>
Date: Wed, 18 May 2016 10:16:54 +0900 (JST)
Subject: [ruby-changes:42969] nobu:r55043 (trunk): enum.c: fix declaration-after-statement

nobu	2016-05-18 10:16:50 +0900 (Wed, 18 May 2016)

  New Revision: 55043

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55043

  Log:
    enum.c: fix declaration-after-statement
    
    * enum.c (sum_iter): workaround of mixed declarations and code.
      erred by -Werror=declaration-after-statement option.

  Modified files:
    trunk/enum.c
Index: enum.c
===================================================================
--- enum.c	(revision 55042)
+++ enum.c	(revision 55043)
@@ -3574,7 +3574,7 @@ struct enum_sum_memo { https://github.com/ruby/ruby/blob/trunk/enum.c#L3574
 static void
 sum_iter(VALUE i, struct enum_sum_memo *memo)
 {
-    assert(memo != NULL);
+    const int unused = (assert(memo != NULL), 0);
 
     long n = memo->n;
     VALUE v = memo->v;
@@ -3663,6 +3663,7 @@ sum_iter(VALUE i, struct enum_sum_memo * https://github.com/ruby/ruby/blob/trunk/enum.c#L3663
     memo->r = r;
     memo->f = f;
     memo->c = c;
+    (void)unused;
 }
 
 static VALUE

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]