Merge branch 'bugfix/bluedroid_warnings' into 'master'

bluedroid: fix warnings

Closes GCC-242

See merge request espressif/esp-idf!17872
This commit is contained in:
Anton Maklakov 2022-05-16 13:36:36 +08:00
commit cc2010682d
13 changed files with 53 additions and 11 deletions

View File

@ -673,6 +673,13 @@ if(CONFIG_BT_ENABLED)
target_link_libraries(${COMPONENT_LIB} PRIVATE nimblelib)
endif()
set_source_files_properties(
"host/bluedroid/bta/gatt/bta_gattc_act.c"
"host/bluedroid/bta/gatt/bta_gattc_cache.c"
"host/bluedroid/btc/profile/std/gatt/btc_gatt_util.c"
"host/bluedroid/btc/profile/std/gatt/btc_gatts.c"
PROPERTIES COMPILE_FLAGS -Wno-address-of-packed-member)
endif()
if(CONFIG_BT_NIMBLE_MESH)

View File

@ -77,7 +77,7 @@ static inline int bt_mesh_beacon_key(const uint8_t net_key[16],
}
int bt_mesh_beacon_auth(const uint8_t beacon_key[16], uint8_t flags,
const uint8_t net_id[16], uint32_t iv_index,
const uint8_t net_id[8], uint32_t iv_index,
uint8_t auth[8]);
static inline int bt_mesh_app_id(const uint8_t app_key[16], uint8_t app_id[1])

View File

@ -66,7 +66,7 @@ static UINT8 bta_dm_pin_cback (BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NAME bd_
static UINT8 bta_dm_new_link_key_cback(BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NAME bd_name, LINK_KEY key, UINT8 key_type, BOOLEAN sc_support);
static UINT8 bta_dm_authentication_complete_cback(BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NAME bd_name, int result);
#endif ///SMP_INCLUDED == TRUE
static void bta_dm_local_name_cback(BD_ADDR bd_addr);
static void bta_dm_local_name_cback(const BD_ADDR bd_addr);
static BOOLEAN bta_dm_check_av(UINT16 event);
static void bta_dm_bl_change_cback (tBTM_BL_EVENT_DATA *p_data);
@ -3265,10 +3265,10 @@ static UINT8 bta_dm_sp_cback (tBTM_SP_EVT event, tBTM_SP_EVT_DATA *p_data)
** Returns void
**
*******************************************************************************/
static void bta_dm_local_name_cback(UINT8 *p_name)
static void bta_dm_local_name_cback(const BD_ADDR bd_addr)
{
tBTA_DM_SEC sec_event;
UNUSED(p_name);
UNUSED(bd_addr);
sec_event.enable.status = BTA_SUCCESS;

View File

@ -612,7 +612,7 @@ static UINT8 bta_ag_parse_chld(tBTA_AG_SCB *p_scb, char *p_s)
INT16 idx = -1;
UNUSED(p_scb);
if (!isdigit(p_s[0])) {
if (!isdigit((unsigned char)p_s[0])) {
return BTA_AG_INVALID_CHLD;
}

View File

@ -237,7 +237,7 @@ BOOLEAN btm_ble_get_acl_remote_addr(tBTM_SEC_DEV_REC *p_dev_rec, BD_ADDR conn_ad
** Returns void
**
*******************************************************************************/
void btm_acl_created (BD_ADDR bda, DEV_CLASS dc, BD_NAME bdn,
void btm_acl_created (BD_ADDR bda, DEV_CLASS dc, UINT8 bdn[BTM_MAX_REM_BD_NAME_LEN],
UINT16 hci_handle, UINT8 link_role, tBT_TRANSPORT transport)
{
tBTM_SEC_DEV_REC *p_dev_rec = NULL;

View File

@ -1557,7 +1557,7 @@ void btm_ble_ltk_request(UINT16 handle, UINT8 rand[8], UINT16 ediv)
{
tBTM_CB *p_cb = &btm_cb;
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev_by_handle (handle);
BT_OCTET8 dummy_stk = {0};
BT_OCTET16 dummy_stk = {0};
BTM_TRACE_DEBUG ("btm_ble_ltk_request");

View File

@ -266,7 +266,7 @@ void btm_dev_timeout (TIMER_LIST_ENT *p_tle)
** Returns void
**
*******************************************************************************/
static void btm_decode_ext_features_page (UINT8 page_number, const UINT8 *p_features)
static void btm_decode_ext_features_page (UINT8 page_number, const BD_FEATURES p_features)
{
BTM_TRACE_DEBUG ("btm_decode_ext_features_page page: %d", page_number);
switch (page_number) {

View File

@ -1023,7 +1023,7 @@ BOOLEAN btm_lookup_eir(BD_ADDR_PTR p_rem_addr);
*/
void btm_acl_free(void);
void btm_acl_init (void);
void btm_acl_created (BD_ADDR bda, DEV_CLASS dc, BD_NAME bdn,
void btm_acl_created (BD_ADDR bda, DEV_CLASS dc, UINT8 bdn[BTM_MAX_REM_BD_NAME_LEN],
UINT16 hci_handle, UINT8 link_role, tBT_TRANSPORT transport);
void btm_acl_removed (BD_ADDR bda, tBT_TRANSPORT transport);
void btm_acl_device_down (void);

View File

@ -1054,7 +1054,7 @@ BOOLEAN btsnd_hcic_delete_stored_key (BD_ADDR bd_addr, BOOLEAN delete_all_flag)
return (TRUE);
}
BOOLEAN btsnd_hcic_change_name (BD_NAME name)
BOOLEAN btsnd_hcic_change_name (const UINT8 *name)
{
BT_HDR *p;
UINT8 *pp;

View File

@ -498,7 +498,7 @@ BOOLEAN btsnd_hcic_delete_stored_key (BD_ADDR bd_addr, BOOLEAN delete_all_flag);
/* Delete Stored Key */
/* Change Local Name */
BOOLEAN btsnd_hcic_change_name(BD_NAME name);
BOOLEAN btsnd_hcic_change_name (const UINT8 *name);
#define HCIC_PARAM_SIZE_CHANGE_NAME BD_NAME_LEN

View File

@ -159,9 +159,15 @@ static void example_change_led_state(uint8_t onoff)
/* When the node receives the first Generic OnOff Get/Set/Set Unack message, it will
* start the timer used to disable fast provisioning functionality.
*/
#pragma GCC diagnostic push
#if __GNUC__ >= 9
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
#endif
if (!bt_mesh_atomic_test_and_set_bit(fast_prov_server.srv_flags, DISABLE_FAST_PROV_START)) {
k_delayed_work_submit(&fast_prov_server.disable_fast_prov_timer, DISABLE_FAST_PROV_TIMEOUT);
}
#pragma GCC diagnostic pop
}
static void node_prov_complete(uint16_t net_idx, uint16_t addr, uint8_t flags, uint32_t iv_index)
@ -231,12 +237,17 @@ static void provisioner_prov_complete(int node_idx, const uint8_t uuid[16], uint
}
if (fast_prov_server.node_addr_cnt != FAST_PROV_NODE_COUNT_MIN &&
fast_prov_server.node_addr_cnt <= fast_prov_server.max_node_num) {
#pragma GCC diagnostic push
#if __GNUC__ >= 9
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
#endif
if (bt_mesh_atomic_test_and_clear_bit(fast_prov_server.srv_flags, GATT_PROXY_ENABLE_START)) {
k_delayed_work_cancel(&fast_prov_server.gatt_proxy_enable_timer);
}
if (!bt_mesh_atomic_test_and_set_bit(fast_prov_server.srv_flags, GATT_PROXY_ENABLE_START)) {
k_delayed_work_submit(&fast_prov_server.gatt_proxy_enable_timer, GATT_PROXY_ENABLE_TIMEOUT);
}
#pragma GCC diagnostic pop
}
} else {
/* When a device is provisioned, the non-primary Provisioner shall reset the timer
@ -250,6 +261,10 @@ static void provisioner_prov_complete(int node_idx, const uint8_t uuid[16], uint
}
}
#pragma GCC diagnostic push
#if __GNUC__ >= 9
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
#endif
if (bt_mesh_atomic_test_bit(fast_prov_server.srv_flags, DISABLE_FAST_PROV_START)) {
/* When a device is provisioned, and the stop_prov flag of the Provisioner has been
* set, the Provisioner shall reset the timer which is used to stop the provisioner
@ -258,6 +273,7 @@ static void provisioner_prov_complete(int node_idx, const uint8_t uuid[16], uint
k_delayed_work_cancel(&fast_prov_server.disable_fast_prov_timer);
k_delayed_work_submit(&fast_prov_server.disable_fast_prov_timer, DISABLE_FAST_PROV_TIMEOUT);
}
#pragma GCC diagnostic pop
/* The Provisioner will send Config AppKey Add to the node. */
example_msg_common_info_t info = {

View File

@ -171,9 +171,14 @@ static void example_change_led_state(uint8_t onoff)
/* When the node receives the first Generic OnOff Get/Set/Set Unack message, it will
* start the timer used to disable fast provisioning functionality.
*/
#pragma GCC diagnostic push
#if __GNUC__ >= 9
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
#endif
if (!bt_mesh_atomic_test_and_set_bit(fast_prov_server.srv_flags, DISABLE_FAST_PROV_START)) {
k_delayed_work_submit(&fast_prov_server.disable_fast_prov_timer, DISABLE_FAST_PROV_TIMEOUT);
}
#pragma GCC diagnostic pop
}
static void node_prov_complete(uint16_t net_idx, uint16_t addr, uint8_t flags, uint32_t iv_index)
@ -241,6 +246,10 @@ static void provisioner_prov_complete(int node_idx, const uint8_t uuid[16], uint
ESP_LOGE(TAG, "%s: Failed to store node address 0x%04x", __func__, unicast_addr);
return;
}
#pragma GCC diagnostic push
#if __GNUC__ >= 9
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
#endif
if (fast_prov_server.node_addr_cnt != FAST_PROV_NODE_COUNT_MIN &&
fast_prov_server.node_addr_cnt <= fast_prov_server.max_node_num) {
if (bt_mesh_atomic_test_and_clear_bit(fast_prov_server.srv_flags, GATT_PROXY_ENABLE_START)) {
@ -250,6 +259,7 @@ static void provisioner_prov_complete(int node_idx, const uint8_t uuid[16], uint
k_delayed_work_submit(&fast_prov_server.gatt_proxy_enable_timer, GATT_PROXY_ENABLE_TIMEOUT);
}
}
#pragma GCC diagnostic pop
} else {
/* When a device is provisioned, the non-primary Provisioner shall reset the timer
* which is used to send node addresses to the primary Provisioner.
@ -262,6 +272,10 @@ static void provisioner_prov_complete(int node_idx, const uint8_t uuid[16], uint
}
}
#pragma GCC diagnostic push
#if __GNUC__ >= 9
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
#endif
if (bt_mesh_atomic_test_bit(fast_prov_server.srv_flags, DISABLE_FAST_PROV_START)) {
/* When a device is provisioned, and the stop_prov flag of the Provisioner has been
* set, the Provisioner shall reset the timer which is used to stop the provisioner
@ -270,6 +284,7 @@ static void provisioner_prov_complete(int node_idx, const uint8_t uuid[16], uint
k_delayed_work_cancel(&fast_prov_server.disable_fast_prov_timer);
k_delayed_work_submit(&fast_prov_server.disable_fast_prov_timer, DISABLE_FAST_PROV_TIMEOUT);
}
#pragma GCC diagnostic pop
/* The Provisioner will send Config AppKey Add to the node. */
example_msg_common_info_t info = {

View File

@ -5,3 +5,7 @@ set(srcs "ble_mesh_fast_prov_client_model.c"
idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS "."
REQUIRES bt)
set_source_files_properties(
"ble_mesh_fast_prov_server_model.c"
PROPERTIES COMPILE_FLAGS -Wno-address-of-packed-member)