From: Willy Tarreau Date: Wed, 23 Mar 2022 10:11:31 +0000 (+0100) Subject: BUILD: stream-int: avoid a build warning when DEBUG is empty X-Git-Tag: v2.6-dev4~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0c3205a541bab01ce7f2b0a5f594d157d8154659;p=thirdparty%2Fhaproxy.git BUILD: stream-int: avoid a build warning when DEBUG is empty When no DEBUG_STRICT is enabled, we get this build warning: src/stream_interface.c: In function 'stream_int_chk_snd_conn': src/stream_interface.c:1198:28: warning: unused variable 'conn' [-Wunused-variable] 1198 | struct connection *conn = cs_conn(cs); | ^~~~ This was the result of the simplification of the code in commit d1480cc8a ("BUG/MEDIUM: stream-int: do not rely on the connection error once established") which removed the last user of this variable outside of a BUG_ON(). If the patch above is backported, this one should be backported as well. --- diff --git a/src/stream_interface.c b/src/stream_interface.c index ae4678bd92..703fd37d0c 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -1195,9 +1195,8 @@ static void stream_int_chk_snd_conn(struct stream_interface *si) { struct channel *oc = si_oc(si); struct conn_stream *cs = si->cs; - struct connection *conn = cs_conn(cs); - BUG_ON(!conn); + BUG_ON(!cs_conn(cs)); if (unlikely(!si_state_in(si->state, SI_SB_CON|SI_SB_RDY|SI_SB_EST) || (oc->flags & CF_SHUTW)))