android/hal-bluetooth.c: In function ‘set_adapter_property’: android/hal-bluetooth.c:659:46: error: taking address of packed member of ‘struct hal_cmd_set_adapter_prop’ may result in an unaligned pointer value [-Werror=address-of-packed-member] 659 | adapter_prop_from_hal(property, &cmd->type, &cmd->len, cmd->val); | ^~~~~~~~~ --- android/hal-bluetooth.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/android/hal-bluetooth.c b/android/hal-bluetooth.c index f22801b04..ee3a5e054 100644 --- a/android/hal-bluetooth.c +++ b/android/hal-bluetooth.c @@ -649,6 +649,7 @@ static int set_adapter_property(const bt_property_t *property) { char buf[IPC_MTU]; struct hal_cmd_set_adapter_prop *cmd = (void *) buf; + uint16_t len_ret; size_t len; DBG("prop: %s", btproperty2str(property)); @@ -656,8 +657,9 @@ static int set_adapter_property(const bt_property_t *property) if (!interface_ready()) return BT_STATUS_NOT_READY; - adapter_prop_from_hal(property, &cmd->type, &cmd->len, cmd->val); + adapter_prop_from_hal(property, &cmd->type, &len_ret, cmd->val); + cmd->len = len_ret; len = sizeof(*cmd) + cmd->len; return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH, HAL_OP_SET_ADAPTER_PROP, -- 2.21.0