Commit 1dab77b4 authored by Alberto Escolar Piedras's avatar Alberto Escolar Piedras Committed by Benjamin Cabé
Browse files

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: default avatarAlberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
parent ed1faa26
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -729,7 +729,7 @@ static struct net_buf *bt_att_chan_create_pdu(struct bt_att_chan *chan, uint8_t
		/* Use a timeout only when responding/confirming */
		timeout = BT_ATT_TIMEOUT;
		break;
	default:
	default: {
		k_tid_t current_thread = k_current_get();

		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
			timeout = K_FOREVER;
		}
	}
	}

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