table: fix maybe-uninitialized variable with gcc lto
authorDennis Marinus <dmarinus@amazon.com>
Tue, 2 Dec 2014 00:39:06 +0000 (16:39 -0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 2 Dec 2014 11:34:09 +0000 (12:34 +0100)
This patch fixes a maybe-uninitialized warning when compiling DPDK with
GCC 4.9 + Link Time Optimization.

Signed-off-by: Dennis Marinus <dmarinus@amazon.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
lib/librte_table/rte_table_lpm.c

index 59f87bb..cf92619 100644 (file)
@@ -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) {