From: Olivier Houchard Date: Fri, 14 Aug 2026 16:59:44 +0000 (+0200) Subject: BUILD: protocol: silence -Warray-bounds in single-group builds X-Git-Tag: v3.5-dev5~29 X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=753415518aab5d36443fa2e8bfafd3fd62115313;p=haproxy.git BUILD: protocol: silence -Warray-bounds in single-group builds When MAX_TGROUPS is 1 (e.g. built without threads), gcc warns that the ha_tgroup_ctx[] accesses in protocol_grab_foreign_receivers() may be out of bounds, as it cannot know that nbtgroups < 2 makes them unreachable. --- diff --git a/src/protocol.c b/src/protocol.c index a4a0332d5..eb44f9802 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -197,7 +197,7 @@ int protocol_getsocks_foreign_fds(struct receiver ***orxs, int **ofds) *orxs = NULL; *ofds = NULL; - if (!(global.tune.options & GTUNE_NO_TG_FD_SHARING) || global.nbtgroups < 2) + if (MAX_TGROUPS < 2 || !(global.tune.options & GTUNE_NO_TG_FD_SHARING) || global.nbtgroups < 2) return 0; /* first pass: count the candidates */