gnu++20:fix build warning to [-Wmaybe-uninitialized].

17:10:41  wireless/bluetooth/bt_slip.c:300:7: error: 'byte' may be used uninitialized [-Werror=maybe-uninitialized]
17:10:41    300 |       wlerr("err: invalid escape byte %x\n", *byte);
17:10:41        |       ^
17:10:41  wireless/bluetooth/bt_slip.c: In function 'bt_slip_receive':
17:10:41  wireless/bluetooth/bt_slip.c:766:11: note: 'byte' was declared here
17:10:41    766 |   uint8_t byte;
17:10:41        |           ^~~~

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
This commit is contained in:
cuiziwei 2024-01-15 17:47:56 +08:00 committed by Xiang Xiao
parent 65fdc5548e
commit a55d62f477
1 changed files with 1 additions and 1 deletions

View File

@ -777,7 +777,7 @@ static int bt_slip_receive(FAR struct bt_driver_s *drv,
FAR uint8_t *packet;
FAR uint8_t *cursor;
FAR uint8_t *header;
uint8_t byte;
uint8_t byte = 0;
uint16_t checksum;
size_t remaining;
uint8_t state;