Skip to content

Commit 1dab77b

Browse files
aescolarkartben
authored andcommitted
Bluetooth: Host: ATT: Fix build warning with clang
Fix the following warning att.c:734:3: warning: label followed by a declaration is a C23 extension [-Wc23-extensions] 734 | k_tid_t current_thread = k_current_get(); | ^ By wrapping that code as a compound statement Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
1 parent ed1faa2 commit 1dab77b

File tree

1 file changed

+2
-1
lines changed
  • subsys/bluetooth/host

1 file changed

+2
-1
lines changed

subsys/bluetooth/host/att.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ static struct net_buf *bt_att_chan_create_pdu(struct bt_att_chan *chan, uint8_t
729729
/* Use a timeout only when responding/confirming */
730730
timeout = BT_ATT_TIMEOUT;
731731
break;
732-
default:
732+
default: {
733733
k_tid_t current_thread = k_current_get();
734734

735735
if (current_thread == k_work_queue_thread_get(&k_sys_work_q)) {
@@ -742,6 +742,7 @@ static struct net_buf *bt_att_chan_create_pdu(struct bt_att_chan *chan, uint8_t
742742
timeout = K_FOREVER;
743743
}
744744
}
745+
}
745746

746747
/* This will reserve headspace for lower layers */
747748
buf = bt_l2cap_create_pdu_timeout(&att_pool, 0, timeout);

0 commit comments

Comments
 (0)