summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-07-28 16:50:26 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-08-06 10:52:00 +0900
commit27173e3735ff509dc8d9cc9b410baff84adf57dc (patch)
tree7b962014a706c970620e1a57b5e4bfacc5acc599 /thread.c
parent58c8b6e86273ccb7a1b903d9ab35956b69b3b1bf (diff)
Allow `RUBY_DEBUG_LOG` format to be empty
GCC warns of empty format strings, perhaps because they have no effects in printf() and there are better ways than sprintf(). However, ruby_debug_log() adds informations other than the format, this warning is not the case.
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/thread.c b/thread.c
index feb89d4352..b271128193 100644
--- a/thread.c
+++ b/thread.c
@@ -1353,14 +1353,14 @@ sleep_hrtime_until(rb_thread_t *th, rb_hrtime_t end, unsigned int fl)
void
rb_thread_sleep_forever(void)
{
- RUBY_DEBUG_LOG("%s", "");
+ RUBY_DEBUG_LOG("");
sleep_forever(GET_THREAD(), SLEEP_SPURIOUS_CHECK);
}
void
rb_thread_sleep_deadly(void)
{
- RUBY_DEBUG_LOG("%s", "");
+ RUBY_DEBUG_LOG("");
sleep_forever(GET_THREAD(), SLEEP_DEADLOCKABLE|SLEEP_SPURIOUS_CHECK);
}
@@ -1384,7 +1384,7 @@ rb_thread_sleep_deadly_allow_spurious_wakeup(VALUE blocker, VALUE timeout, rb_hr
rb_fiber_scheduler_block(scheduler, blocker, timeout);
}
else {
- RUBY_DEBUG_LOG("%s", "");
+ RUBY_DEBUG_LOG("");
if (end) {
sleep_hrtime_until(GET_THREAD(), end, SLEEP_SPURIOUS_CHECK);
}
@@ -1481,7 +1481,7 @@ blocking_region_begin(rb_thread_t *th, struct rb_blocking_region_buffer *region,
th->status = THREAD_STOPPED;
rb_ractor_blocking_threads_inc(th->ractor, __FILE__, __LINE__);
- RUBY_DEBUG_LOG("%s", "");
+ RUBY_DEBUG_LOG("");
RB_GC_SAVE_MACHINE_CONTEXT(th);
thread_sched_to_waiting(TH_SCHED(th));
@@ -1509,7 +1509,7 @@ blocking_region_end(rb_thread_t *th, struct rb_blocking_region_buffer *region)
th->status = region->prev_status;
}
- RUBY_DEBUG_LOG("%s", "");
+ RUBY_DEBUG_LOG("");
VM_ASSERT(th == GET_THREAD());
}