BUILD: traces: set a few __maybe_unused on vars used only for traces

Certain variables are used only for traces in mux, ssl and quic
essentially, and disabling traces emits warnings, so let's mark
them appropriately.
This commit is contained in:
Willy Tarreau 2026-05-20 09:34:26 +02:00
parent f521581922
commit 8dd31dcd07
7 changed files with 12 additions and 12 deletions

View file

@ -981,7 +981,7 @@ static inline void fcgi_strm_propagate_term_flags(struct fcgi_conn *fconn, struc
*/
static void fcgi_strm_destroy(struct fcgi_strm *fstrm)
{
struct connection *conn = fstrm->fconn->conn;
struct connection __maybe_unused *conn = fstrm->fconn->conn;
TRACE_ENTER(FCGI_EV_FSTRM_END, conn, fstrm);
@ -3540,7 +3540,7 @@ static size_t fcgi_strm_parse_trailers(struct fcgi_strm *fstrm, struct h1m *h1m,
static size_t fcgi_strm_parse_response(struct fcgi_strm *fstrm, struct buffer *buf, size_t count)
{
struct fcgi_conn *fconn = fstrm->fconn;
struct fcgi_conn __maybe_unused *fconn = fstrm->fconn;
struct htx *htx;
struct h1m *h1m = &fstrm->h1m;
size_t ret, data, total = 0;
@ -4031,7 +4031,7 @@ static int fcgi_subscribe(struct stconn *sc, int event_type, struct wait_event *
static int fcgi_unsubscribe(struct stconn *sc, int event_type, struct wait_event *es)
{
struct fcgi_strm *fstrm = __sc_mux_strm(sc);
struct fcgi_conn *fconn = fstrm->fconn;
struct fcgi_conn __maybe_unused *fconn = fstrm->fconn;
BUG_ON(event_type & ~(SUB_RETRY_SEND|SUB_RETRY_RECV));
BUG_ON(fstrm->subs && fstrm->subs != es);

View file

@ -1897,7 +1897,7 @@ static void h1_append_chunk_crlf(struct buffer *buf)
*/
static void h1_set_tunnel_mode(struct h1s *h1s)
{
struct h1c *h1c = h1s->h1c;
struct h1c __maybe_unused *h1c = h1s->h1c;
h1s->req.state = H1_MSG_TUNNEL;
h1s->req.flags &= ~(H1_MF_XFER_LEN|H1_MF_CLEN|H1_MF_CHNK);

View file

@ -1281,7 +1281,7 @@ void _h2_trace_header(const struct ist hn, const struct ist hv,
const struct h2c *h2c, const struct h2s *h2s)
{
struct ist n_ist, v_ist;
const char *c_str, *s_str;
const char __maybe_unused *c_str, *s_str;
chunk_reset(&trash);
c_str = chunk_newstr(&trash);
@ -2024,7 +2024,7 @@ static inline void h2s_propagate_term_flags(struct h2c *h2c, struct h2s *h2s)
*/
static void h2s_destroy(struct h2s *h2s)
{
struct connection *conn = h2s->h2c->conn;
struct connection __maybe_unused *conn = h2s->h2c->conn;
int freed = 0;
TRACE_ENTER(H2_EV_H2S_END, conn, h2s);
@ -7613,7 +7613,7 @@ static size_t h2s_make_data(struct h2s *h2s, struct buffer *buf, size_t count)
*/
static size_t h2s_skip_data(struct h2s *h2s, struct buffer *buf, size_t count)
{
struct h2c *h2c = h2s->h2c;
struct h2c __maybe_unused *h2c = h2s->h2c;
struct htx *htx;
int bsize; /* htx block size */
int fsize; /* h2 frame size */

View file

@ -1154,7 +1154,7 @@ static inline void spop_strm_propagate_term_flags(struct spop_conn *spop_conn, s
*/
static void spop_strm_destroy(struct spop_strm *spop_strm)
{
struct connection *conn = spop_strm->spop_conn->conn;
struct connection __maybe_unused *conn = spop_strm->spop_conn->conn;
TRACE_ENTER(SPOP_EV_SPOP_STRM_END, conn, spop_strm);
@ -3199,7 +3199,7 @@ static int spop_subscribe(struct stconn *sc, int event_type, struct wait_event *
static int spop_unsubscribe(struct stconn *sc, int event_type, struct wait_event *es)
{
struct spop_strm *spop_strm = __sc_mux_strm(sc);
struct spop_conn *spop_conn = spop_strm->spop_conn;
struct spop_conn __maybe_unused *spop_conn = spop_strm->spop_conn;
BUG_ON(event_type & ~(SUB_RETRY_SEND|SUB_RETRY_RECV));
BUG_ON(spop_strm->subs && spop_strm->subs != es);

View file

@ -710,7 +710,7 @@ static inline int ha_quic_set_write_secret(SSL *ssl, enum ssl_encryption_level_t
static int ha_quic_flush_flight(SSL *ssl)
{
struct quic_conn *qc = SSL_get_ex_data(ssl, ssl_qc_app_data_index);
struct quic_conn __maybe_unused *qc = SSL_get_ex_data(ssl, ssl_qc_app_data_index);
TRACE_ENTER(QUIC_EV_CONN_FFLIGHT, qc);
TRACE_LEAVE(QUIC_EV_CONN_FFLIGHT, qc);

View file

@ -1060,7 +1060,7 @@ int quic_tls_key_update(struct quic_conn *qc)
struct quic_tls_secrets *rx = &tls_ctx->rx;
struct quic_tls_secrets *tx = &tls_ctx->tx;
/* Used only for the traces */
struct quic_kp_trace kp_trace = {
struct quic_kp_trace __maybe_unused kp_trace = {
.rx_sec = rx->secret,
.rx_seclen = rx->secretlen,
.tx_sec = tx->secret,

View file

@ -349,7 +349,7 @@ int ssl_sock_switchctx_cbk(SSL *ssl, int *al, void *arg)
if ((TRACE_SOURCE)->verbosity >= SSL_VERB_ADVANCED) {
if (TRACE_ENABLED(TRACE_LEVEL_DATA, SSL_EV_CONN_CIPHERS_EXT, conn, 0, 0, 0)) {
const uint8_t *cipher_suites;
size_t len;
size_t __maybe_unused len;
#if defined(OPENSSL_IS_BORINGSSL) || defined(OPENSSL_IS_AWSLC)
len = ctx->cipher_suites_len;