From 0ba44e9f0130f57471d09f2a31358d0184defb9e Mon Sep 17 00:00:00 2001 From: Oleksandr Nychyporuk Date: Sat, 20 Dec 2025 17:36:08 +0200 Subject: [PATCH] nimble/host: fix unused variable warnings Move variable declarations under a conditional compilation block. This prevents compiler warnings when queued write timeouts and L2CAP fragmentation are disabled, as the variables are then unused. --- nimble/host/src/ble_hs_conn.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nimble/host/src/ble_hs_conn.c b/nimble/host/src/ble_hs_conn.c index ba034a2703..8d4343bf75 100644 --- a/nimble/host/src/ble_hs_conn.c +++ b/nimble/host/src/ble_hs_conn.c @@ -481,11 +481,14 @@ ble_hs_conn_timer(void) #endif struct ble_hs_conn *conn; - ble_npl_time_t now = ble_npl_time_get(); int32_t next_exp_in = BLE_HS_FOREVER; int32_t next_exp_in_new; bool next_exp_in_updated; + +#if BLE_HS_ATT_SVR_QUEUED_WRITE_TMO || MYNEWT_VAL(BLE_L2CAP_RX_FRAG_TIMEOUT) != 0 + ble_npl_time_t now = ble_npl_time_get(); int32_t time_diff; +#endif ble_hs_lock();