From bf639e581dff40331a8549f401d9a206f5e05fac Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Fri, 14 Nov 2025 11:35:38 +0100 Subject: [PATCH] BUILD: ech: fix clang warnings No impact as the state is either SHOW_ECH_SPECIFIC or SHOW_ECH_ALL but never anything else. src/ech.c:240:6: error: variable 'p' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] 240 | if (ctx->state == SHOW_ECH_ALL) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~ src/ech.c:275:12: note: uninitialized use occurs here 275 | ctx->pp = p; | ^ src/ech.c:240:2: note: remove the 'if' if its condition is always true 240 | if (ctx->state == SHOW_ECH_ALL) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/ech.c:228:17: note: initialize the variable 'p' to silence this warning 228 | struct proxy *p; | ^ | = NULL src/ech.c:240:6: error: variable 'bind_conf' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] 240 | if (ctx->state == SHOW_ECH_ALL) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~ src/ech.c:276:11: note: uninitialized use occurs here 276 | ctx->b = bind_conf; | ^~~~~~~~~ src/ech.c:240:2: note: remove the 'if' if its condition is always true 240 | if (ctx->state == SHOW_ECH_ALL) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/ech.c:229:29: note: initialize the variable 'bind_conf' to silence this warning 229 | struct bind_conf *bind_conf; | ^ | = NULL 2 errors generated. make: *** [Makefile:1062: src/ech.o] Error 1 --- src/ech.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ech.c b/src/ech.c index 2acd898e1..e448ff781 100644 --- a/src/ech.c +++ b/src/ech.c @@ -225,8 +225,8 @@ static int cli_io_handler_ech_details(struct appctx *appctx) struct buffer *trash = get_trash_chunk(); struct show_ech_ctx *ctx = appctx->svcctx; int ret = 0; - struct proxy *p; - struct bind_conf *bind_conf; + struct proxy *p = NULL; + struct bind_conf *bind_conf = NULL; if (!ctx) return 1; if (ctx->state == SHOW_ECH_SPECIFIC) {