Skip to contentSkip to conversation

lpm: fix maybe-uninitialized warning when using LTO during compilation

PATCH Applied Dennis Marinus 3 participants 3 messages Dec 2, 2014 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lpm: fix maybe-uninitialized warning when using LTO during compilation

This patch fixes a maybe-uninitialized warning when compiling DPDK with GCC 4.9 + Link Time Optimization.

---
 lib/librte_table/rte_table_lpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_table/rte_table_lpm.c +1 -1
index 59f87bb..cf92619 100644
@@ -185,7 +185,7 @@ rte_table_lpm_entry_add(
 	struct rte_table_lpm_key *ip_prefix = (struct rte_table_lpm_key *) key;
 	uint32_t nht_pos, nht_pos0_valid;
 	int status;
-	uint8_t nht_pos0;
+	uint8_t nht_pos0 = 0;
 
 	/* Check input parameters */
 	if (lpm == NULL) {
Signature · 1 line
2.1.2.AMZN

A message that is not in the archive (sent off-list or not yet received): 1417480746-25902-1-git-send-email-dmarinus-vV1OtcyAfmbQT0dZR+AlfA@public.gmane.org

#2 lore raw
Quoted 4 lines · Dennis Marinus

This patch fixes a maybe-uninitialized warning when compiling DPDK with GCC 4.9 + Link Time Optimization.

Quoted 20 lines
---
 lib/librte_table/rte_table_lpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_table/rte_table_lpm.c +1 -1
index 59f87bb..cf92619 100644
@@ -185,7 +185,7 @@ rte_table_lpm_entry_add(
 	struct rte_table_lpm_key *ip_prefix = (struct rte_table_lpm_key *) key;
 	uint32_t nht_pos, nht_pos0_valid;
 	int status;
-	uint8_t nht_pos0;
+	uint8_t nht_pos0 = 0;
 
 	/* Check input parameters */
 	if (lpm == NULL) {
Signature · 1 line
2.1.2.AMZN