Skip to content

Commit f9b9e47

Browse files
author
Arto Kinnunen
authored
Fix GCC_ARM/ARM compiler warnings (ARMmbed#1777)
-'invalid_addr_ptr' may be used uninitialized in this function -'neigh_entry_ptr' may be used uninitialized in this function -'buffer' may be used uninitialized in this function -format '%u' expects argument of type 'unsigned int', but argument 5 has type 'uint32_t -statement with no effect -type qualifier specified more than once -statement is unreachable
1 parent 40efd39 commit f9b9e47

File tree

7 files changed

+10
-9
lines changed

7 files changed

+10
-9
lines changed

source/6LoWPAN/Thread/thread_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ int thread_attach_ready(protocol_interface_info_entry_t *cur)
839839
case THREAD_STATE_CONNECTED:
840840
case THREAD_STATE_CONNECTED_ROUTER:
841841
return 0;
842-
break;
842+
/* break; */
843843
default:
844844
break;
845845
}

source/6LoWPAN/Thread/thread_extension_bbr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,7 @@ static int thread_extension_bbr_mlr_cb(int8_t service_id, uint8_t source_address
677677
uint16_t addr_len;
678678
uint16_t session_id;
679679
uint8_t *addr_data_ptr;
680+
uint8_t *invalid_addr_ptr = NULL;
680681
uint32_t timeout_value;
681682
uint8_t bbr_rloc_addr[16];
682683
uint8_t bbr_status = THREAD_BBR_STATUS_SUCCESS;
@@ -724,7 +725,6 @@ static int thread_extension_bbr_mlr_cb(int8_t service_id, uint8_t source_address
724725

725726
int16_t remaining = addr_len;
726727
uint8_t *addr_ptr = addr_data_ptr;
727-
uint8_t *invalid_addr_ptr = NULL;
728728

729729
if ( addr_len < 16 ||
730730
addr_len % 16 != 0 ) {

source/6LoWPAN/adaptation_interface.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,13 +611,13 @@ static fragmenter_tx_entry_t * lowpan_adaptation_tx_process_init(fragmenter_inte
611611

612612
buffer_t * lowpan_adaptation_data_process_tx_preprocess(protocol_interface_info_entry_t *cur, buffer_t *buf)
613613
{
614+
mac_neighbor_table_entry_t *neigh_entry_ptr = NULL;
615+
614616
//Validate is link known and set indirect, datareq and security key id mode
615617
if (buf->dst_sa.addr_type == ADDR_NONE) {
616618
goto tx_error_handler;
617619
}
618620

619-
mac_neighbor_table_entry_t *neigh_entry_ptr = NULL;
620-
621621
/* If MLE is enabled, we will talk if we have an MLE association */
622622
if (buf->dst_sa.addr_type == ADDR_802_15_4_LONG ) {
623623
neigh_entry_ptr = mac_neighbor_table_address_discover(mac_neighbor_info(cur), buf->dst_sa.address + 2, buf->dst_sa.addr_type);

source/MAC/IEEE802_15_4/mac_pd_sap.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ static bool mac_pd_sap_ack_validation(protocol_interface_rf_mac_setup_s *rf_ptr,
531531
int8_t mac_pd_sap_data_cb(void *identifier, arm_phy_sap_msg_t *message)
532532
{
533533
protocol_interface_rf_mac_setup_s *rf_ptr = (protocol_interface_rf_mac_setup_s*)identifier;
534+
mac_pre_parsed_frame_t *buffer = NULL;
534535

535536
if (!rf_ptr || !message ) {
536537
return -1;
@@ -615,7 +616,7 @@ int8_t mac_pd_sap_data_cb(void *identifier, arm_phy_sap_msg_t *message)
615616
}
616617
}
617618

618-
mac_pre_parsed_frame_t *buffer = mcps_sap_pre_parsed_frame_buffer_get(pd_data_ind->data_ptr, pd_data_ind->data_len);
619+
buffer = mcps_sap_pre_parsed_frame_buffer_get(pd_data_ind->data_ptr, pd_data_ind->data_len);
619620

620621
if (!buffer) {
621622
sw_mac_stats_update(rf_ptr, STAT_MAC_RX_DROP, 0);

source/MAC/IEEE802_15_4/sw_mac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static int8_t ns_sw_mac_api_enable_mcps_ext(mac_api_t *api, mcps_data_indication
5353

5454
static void mlme_req(const mac_api_t* api, mlme_primitive id, const void *data);
5555
static void mcps_req(const mac_api_t* api, const mcps_data_req_t *data);
56-
static void mcps_req_ext(const mac_api_t* api, const mcps_data_req_t *data, const const mcps_data_req_ie_list_t *ie_ext, const channel_list_s *asynch_channel_list);
56+
static void mcps_req_ext(const mac_api_t* api, const mcps_data_req_t *data, const mcps_data_req_ie_list_t *ie_ext, const channel_list_s *asynch_channel_list);
5757
static void purge_req(const mac_api_t* api, const mcps_purge_t *data);
5858
static int8_t macext_mac64_address_set( const mac_api_t* api, const uint8_t *mac64);
5959
static int8_t macext_mac64_address_get( const mac_api_t* api, mac_extended_address_type type, uint8_t *mac64_buf);

source/Service_Libs/mac_neighbor_table/mac_neighbor_table.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ void mac_neighbor_table_neighbor_timeout_update(mac_neighbor_table_t *table_clas
111111
if (table_class->user_nud_notify_cb(cur, table_class->table_user_identifier)) {
112112
table_class->active_nud_process++;
113113
cur->nud_active = true;
114-
tr_debug("Nud started index %u : %u time ", cur->index, cur->lifetime);
114+
tr_debug("Nud started index %u : %"PRIu32" time ", cur->index, cur->lifetime);
115115
}
116116

117117
} else {
@@ -176,7 +176,7 @@ void mac_neighbor_table_neighbor_refresh(mac_neighbor_table_t *table_class, mac_
176176
neighbor_entry->lifetime = life_time;
177177
neighbor_entry->link_lifetime = life_time;
178178
if (neighbor_entry->nud_active) {
179-
tr_debug("Node index NUD response %u : %u time ", neighbor_entry->index, neighbor_entry->lifetime);
179+
tr_debug("Node index NUD response %u : %"PRIu32" time ", neighbor_entry->index, neighbor_entry->lifetime);
180180
neighbor_entry->nud_active = false;
181181
table_class->active_nud_process--;
182182
}

source/Service_Libs/whiteboard/whiteboard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ extern uint16_t whiteboard_size_get(void);
3737
#define whiteboard_rm_entry(id, address)
3838
#define whiteboard_table_check_address(address) NULL
3939
#define whiteboard_table_update(address, eui64, status) NULL
40-
#define whiteboard_interface_unregister_all_address(nwk_id) -1
40+
#define whiteboard_interface_unregister_all_address(nwk_id)
4141
#define whiteboard_interface_address_cmp(address) false
4242
#endif
4343

0 commit comments

Comments
 (0)