From 9729651bb5f8cab445332e99cf548b75f67950e2 Mon Sep 17 00:00:00 2001 From: Herman Berget Date: Thu, 18 Apr 2024 14:30:02 +0200 Subject: [PATCH] ipc_service: backends: icbmsg: Silence maybe-uninitialized warning If compiling with optimizations (-O2/-Ofast) gcc emits a maybe-uninitialized warning for `size`. As far as I can tell, `size` will always be initialized in the cases where it is used and only left uninitialized in error cases. Reproduced on main with the multi_endpoint sample on nrf5340dk/nrf5340/cpuapp. Signed-off-by: Herman Berget --- subsys/ipc/ipc_service/backends/ipc_icbmsg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/ipc/ipc_service/backends/ipc_icbmsg.c b/subsys/ipc/ipc_service/backends/ipc_icbmsg.c index c7cb5f8ea3..02deaa7716 100644 --- a/subsys/ipc/ipc_service/backends/ipc_icbmsg.c +++ b/subsys/ipc/ipc_service/backends/ipc_icbmsg.c @@ -461,7 +461,7 @@ static int release_tx_buffer(struct backend_data *dev_data, const uint8_t *buffe int new_size) { const struct icbmsg_config *conf = dev_data->conf; - size_t size; + size_t size = 0; int tx_block_index; tx_block_index = buffer_to_index_validate(&conf->tx, buffer, &size);