From: Willy Tarreau Date: Thu, 25 Jun 2026 08:48:44 +0000 (+0200) Subject: BUILD: task: silence a build warning with threads disabled X-Git-Tag: v3.5-dev1~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a00b1129694191e2665eecb6ec1d1fb9e6b3e4d;p=thirdparty%2Fhaproxy.git BUILD: task: silence a build warning with threads disabled The compiler doesn't know that a random value based on global.nbthread is necessarily smaller than MAX_THREADS, and when picking a random thread number while single-threaded it complains that new_tid 1 is out of bounds for the array. In fact all this is dead code in this case. Let's tell it about it to silence the warning. --- diff --git a/src/task.c b/src/task.c index cde958e83..8eabb4633 100644 --- a/src/task.c +++ b/src/task.c @@ -395,6 +395,8 @@ void wake_expired_tasks() if (new_tid == tid) continue; + + ASSUME(new_tid < MAX_THREADS); if (ha_thread_ctx[new_tid].rq_total * 2 < th_ctx->rq_total) { int cur_state; do {