]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUILD: connections: shut up gcc about impossible out-of-bounds warning
authorWilly Tarreau <w@1wt.eu>
Sun, 26 May 2019 09:50:08 +0000 (11:50 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 26 May 2019 09:54:20 +0000 (11:54 +0200)
commit08e2b41e8183bede36f4fca1b8f849f18e4be13e
treec566881ae0dbc6e22273f981effa2868643fcff3
parent9c218e7521c751256e530c9ccb8482cadd2560bb
BUILD: connections: shut up gcc about impossible out-of-bounds warning

Since commit 88698d9 ("MEDIUM: connections: Add a way to control the
number of idling connections.") when building without threads, gcc
complains that the operations made on the idle_orphan_conns[] list is
out of bounds, which is always false since 1) <i> can only equal zero,
and 2) given it's equal to <tid> we never even enter the loop. But as
usual it thinks it knows better, so let's mask the origin of this <i>
value to shut it up. Another solution consists in making <i> unsigned
and adding an explicit range check.
src/backend.c