Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pybricks.common.ble: fix compiler warning
With GCC 13 and -flto disabled, we were getting warnings like: ../../pybricks/common/pb_type_ble.c:291:21: error: array subscript 5 is outside the bounds of an interior zero-length array 'uint8_t[0]' {aka 'unsigned char[]'} [-Werror=zero-length-bounds] 291 | value.v.data[5] = PB_BLE_BROADCAST_DATA_TYPE_SINGLE_OBJECT << 5; | ~ Instead of using the zero-length array, access the d member directly. This allows the compiler to actually check for out of bounds access and warn us about it.
- Loading branch information