From 5a84d3d01f7f155c6b1c1b771891041585ed53b4 Mon Sep 17 00:00:00 2001 From: Tommi Rantanen Date: Mon, 30 Sep 2024 11:30:18 +0300 Subject: [PATCH] net: lib: coap: Initialize response_truncated Fix the following compilation warning given when using newlibc: warning: 'response_truncated' may be used uninitialized [-Wmaybe-uninitialized] Issue is not seen with picolibc. The variable was introduced as part of PR #76257 Signed-off-by: Tommi Rantanen --- subsys/net/lib/coap/coap_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/net/lib/coap/coap_client.c b/subsys/net/lib/coap/coap_client.c index 218eebe3368c74..9fd67e46c4e178 100644 --- a/subsys/net/lib/coap/coap_client.c +++ b/subsys/net/lib/coap/coap_client.c @@ -928,7 +928,7 @@ static void coap_client_recv(void *coap_cl, void *a, void *b) for (int i = 0; i < num_clients; i++) { if (clients[i]->response_ready) { struct coap_packet response; - bool response_truncated; + bool response_truncated = false; k_mutex_lock(&clients[i]->lock, K_FOREVER);