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

ruby-changes:68538

From: Kazuhiro <ko1@a...>
Date: Wed, 20 Oct 2021 07:48:41 +0900 (JST)
Subject: [ruby-changes:68538] 9b18f1bffe (master): Supress `warning: data argument not used by format string [-Wformat-extra-args]`

https://git.ruby-lang.org/ruby.git/commit/?id=9b18f1bffe

From 9b18f1bffe056f9f3e0c37b7c847ecb3ca942307 Mon Sep 17 00:00:00 2001
From: Kazuhiro NISHIYAMA <zn@m...>
Date: Tue, 28 Sep 2021 18:00:03 +0900
Subject: Supress `warning: data argument not used by format string
 [-Wformat-extra-args]`

---
 ractor.c         |  8 ++++----
 transient_heap.c |  4 ++--
 vm_debug.h       | 14 +++++++-------
 vm_sync.c        |  6 +++---
 4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/ractor.c b/ractor.c
index daf6f38f4d..9253327165 100644
--- a/ractor.c
+++ b/ractor.c
@@ -901,7 +901,7 @@ ractor_send_basket(rb_execution_context_t *ec, rb_ractor_t *r, struct rb_ractor_ https://github.com/ruby/ruby/blob/trunk/ractor.c#L901
         else {
             ractor_queue_enq(r, rq, b);
             if (ractor_wakeup(r, wait_receiving, wakeup_by_send)) {
-                RUBY_DEBUG_LOG("wakeup", 0);
+                RUBY_DEBUG_LOG("wakeup");
             }
         }
     }
@@ -1348,7 +1348,7 @@ ractor_close_incoming(rb_execution_context_t *ec, rb_ractor_t *r) https://github.com/ruby/ruby/blob/trunk/ractor.c#L1348
             r->sync.incoming_port_closed = true;
             if (ractor_wakeup(r, wait_receiving, wakeup_by_close)) {
                 VM_ASSERT(r->sync.incoming_queue.cnt == 0);
-                RUBY_DEBUG_LOG("cancel receiving", 0);
+                RUBY_DEBUG_LOG("cancel receiving");
             }
         }
         else {
@@ -1385,7 +1385,7 @@ ractor_close_outgoing(rb_execution_context_t *ec, rb_ractor_t *r) https://github.com/ruby/ruby/blob/trunk/ractor.c#L1385
         // raising yielding Ractor
         if (!r->yield_atexit &&
             ractor_wakeup(r, wait_yielding, wakeup_by_close)) {
-            RUBY_DEBUG_LOG("cancel yielding", 0);
+            RUBY_DEBUG_LOG("cancel yielding");
         }
     }
     RACTOR_UNLOCK(r);
@@ -1418,7 +1418,7 @@ static void https://github.com/ruby/ruby/blob/trunk/ractor.c#L1418
 cancel_single_ractor_mode(void)
 {
     // enable multi-ractor mode
-    RUBY_DEBUG_LOG("enable multi-ractor mode", 0);
+    RUBY_DEBUG_LOG("enable multi-ractor mode");
 
     VALUE was_disabled = rb_gc_enable();
 
diff --git a/transient_heap.c b/transient_heap.c
index 5b6fd89889..d2cf8e4bd9 100644
--- a/transient_heap.c
+++ b/transient_heap.c
@@ -825,7 +825,7 @@ transient_heap_evacuate(void *dmy) https://github.com/ruby/ruby/blob/trunk/transient_heap.c#L825
             transient_heap_update_status(theap, transient_heap_none);
         }
         if (gc_disabled != Qtrue) rb_gc_enable();
-        RUBY_DEBUG_LOG("finish", 0);
+        RUBY_DEBUG_LOG("finish");
     }
 }
 
@@ -962,7 +962,7 @@ void https://github.com/ruby/ruby/blob/trunk/transient_heap.c#L962
 rb_transient_heap_finish_marking(void)
 {
     ASSERT_vm_locking();
-    RUBY_DEBUG_LOG("", 0);
+    RUBY_DEBUG_LOG("");
 
     struct transient_heap* theap = transient_heap_get();
 
diff --git a/vm_debug.h b/vm_debug.h
index 2840e70646..8f7027224d 100644
--- a/vm_debug.h
+++ b/vm_debug.h
@@ -94,24 +94,24 @@ bool ruby_debug_log_filter(const char *func_name); https://github.com/ruby/ruby/blob/trunk/vm_debug.h#L94
 
 // convenient macro to log even if the USE_RUBY_DEBUG_LOG macro is not specified.
 // You can use this macro for temporary usage (you should not commit it).
-#define _RUBY_DEBUG_LOG(fmt, ...) ruby_debug_log(__FILE__, __LINE__, __func__, fmt, __VA_ARGS__)
+#define _RUBY_DEBUG_LOG(...) ruby_debug_log(__FILE__, __LINE__, __func__, __VA_ARGS__)
 
 #if USE_RUBY_DEBUG_LOG
 
-#define RUBY_DEBUG_LOG(fmt, ...) do { \
+#define RUBY_DEBUG_LOG(...) do { \
   if (ruby_debug_log_mode && ruby_debug_log_filter(__func__)) \
-    ruby_debug_log(__FILE__, __LINE__, __func__, fmt, __VA_ARGS__); \
+    ruby_debug_log(__FILE__, __LINE__, __func__, __VA_ARGS__); \
 } while (0)
 
-#define RUBY_DEBUG_LOG2(file, line, fmt, ...) do { \
+#define RUBY_DEBUG_LOG2(file, line, ...) do { \
   if (ruby_debug_log_mode && ruby_debug_log_filter(__func__)) \
-    ruby_debug_log(file, line, __func__, fmt, __VA_ARGS__); \
+    ruby_debug_log(file, line, __func__, __VA_ARGS__); \
 } while (0)
 
 #else
 // do nothing
-#define RUBY_DEBUG_LOG(fmt, ...)
-#define RUBY_DEBUG_LOG2(file, line, fmt, ...)
+#define RUBY_DEBUG_LOG(...)
+#define RUBY_DEBUG_LOG2(file, line, ...)
 #endif // USE_RUBY_DEBUG_LOG
 
 #endif /* RUBY_DEBUG_H */
diff --git a/vm_sync.c b/vm_sync.c
index 1ce8cad95f..038e87f53b 100644
--- a/vm_sync.c
+++ b/vm_sync.c
@@ -76,11 +76,11 @@ vm_lock_enter(rb_ractor_t *cr, rb_vm_t *vm, bool locked, bool no_barrier, unsign https://github.com/ruby/ruby/blob/trunk/vm_sync.c#L76
                 VM_ASSERT(rb_ractor_status_p(cr, ractor_blocking));
 
                 if (vm_barrier_finish_p(vm)) {
-                    RUBY_DEBUG_LOG("wakeup barrier owner", 0);
+                    RUBY_DEBUG_LOG("wakeup barrier owner");
                     rb_native_cond_signal(&vm->ractor.sync.barrier_cond);
                 }
                 else {
-                    RUBY_DEBUG_LOG("wait for barrier finish", 0);
+                    RUBY_DEBUG_LOG("wait for barrier finish");
                 }
 
                 // wait for restart
@@ -91,7 +91,7 @@ vm_lock_enter(rb_ractor_t *cr, rb_vm_t *vm, bool locked, bool no_barrier, unsign https://github.com/ruby/ruby/blob/trunk/vm_sync.c#L91
                     vm->ractor.sync.lock_owner = cr;
                 }
 
-                RUBY_DEBUG_LOG("barrier is released. Acquire vm_lock", 0);
+                RUBY_DEBUG_LOG("barrier is released. Acquire vm_lock");
 
                 if (running) {
                     rb_vm_ractor_blocking_cnt_dec(vm, cr, __FILE__, __LINE__);
-- 
cgit v1.2.1


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

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