From 6885e10a68ceded7a2d94986aba1fdfd9b76cc55 Mon Sep 17 00:00:00 2001 From: Tommi Rantanen Date: Mon, 30 Sep 2024 11:30:18 +0300 Subject: [PATCH] [nrf fromlist] 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 Upstream PR: https://github.com/zephyrproject-rtos/zephyr/pull/79186 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 4f2297be958..7c49a90981b 100644 --- a/subsys/net/lib/coap/coap_client.c +++ b/subsys/net/lib/coap/coap_client.c @@ -894,7 +894,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);