Skip to contentSkip to conversation

net/ixgbe: fix build for gcc 4.8.5

PATCH In review Ferruh Yigit 3 participants 4 messages Jan 14, 2020 – Jan 15, 2020 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ixgbe: fix build for gcc 4.8.5

Build error:
In function ‘ixgbe_recv_pkts_lro_bulk_alloc’:
../drivers/net/ixgbe/ixgbe_rxtx.c:2209:24:
error: ‘next_sc_entry’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

    next_sc_entry->fbuf = first_seg;
                        ^

http://mails.dpdk.org/archives/test-report/2020-January/113891.html

This is a compiler false positive and error not seen by newer compilers, or clang but to fix the warning initializing the complained variable.

According git bisect, no idea how:

Fixes 8a2e7ce976fd ("net/ixgbe: avoid multiple definitions of bool")

---
Cc: [email protected]

---
 drivers/net/ixgbe/ixgbe_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
index 13b06eb9c..30f890572 100644
@@ -2028,7 +2028,7 @@ ixgbe_recv_pkts_lro(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts,
 		bool eop;
 		struct ixgbe_rx_entry *rxe;
 		struct ixgbe_scattered_rx_entry *sc_entry;
-		struct ixgbe_scattered_rx_entry *next_sc_entry;
+		struct ixgbe_scattered_rx_entry *next_sc_entry = NULL;
 		struct ixgbe_rx_entry *next_rxe = NULL;
 		struct rte_mbuf *first_seg;
 		struct rte_mbuf *rxm;
Signature · 1 line
2.24.1
Tested-by on v1 1/1
#1 lore raw
Quoted 11 lines · Ferruh Yigit

Build error:
In function ‘ixgbe_recv_pkts_lro_bulk_alloc’:
../drivers/net/ixgbe/ixgbe_rxtx.c:2209:24:
error: ‘next_sc_entry’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

    next_sc_entry->fbuf = first_seg;
                        ^

http://mails.dpdk.org/archives/test-report/2020-January/113891.html

This is a compiler false positive and error not seen by newer compilers, or clang but to fix the warning initializing the complained variable.

You might want to add the RHEL7 GCC version I reproduced it on:

$ gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
Quoted 5 lines

According git bisect, no idea how:

Fixes 8a2e7ce976fd ("net/ixgbe: avoid multiple definitions of bool")
Quoted 20 lines

---
Cc: [email protected]

---
 drivers/net/ixgbe/ixgbe_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
index 13b06eb9c..30f890572 100644
@@ -2028,7 +2028,7 @@ ixgbe_recv_pkts_lro(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts,
 		bool eop;
 		struct ixgbe_rx_entry *rxe;
 		struct ixgbe_scattered_rx_entry *sc_entry;
-		struct ixgbe_scattered_rx_entry *next_sc_entry;
+		struct ixgbe_scattered_rx_entry *next_sc_entry = NULL;
 		struct ixgbe_rx_entry *next_rxe = NULL;
 		struct rte_mbuf *first_seg;
 		struct rte_mbuf *rxm;
Acked-by on v1 1/1
#2 lore raw
In reply to Ferruh Yigit
Quoted 39 lines · Ferruh Yigit

Build error:
In function ‘ixgbe_recv_pkts_lro_bulk_alloc’:
../drivers/net/ixgbe/ixgbe_rxtx.c:2209:24:
error: ‘next_sc_entry’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

   next_sc_entry->fbuf = first_seg;
                       ^

http://mails.dpdk.org/archives/test-report/2020-January/113891.html

This is a compiler false positive and error not seen by newer compilers, or clang but to fix the warning initializing the complained variable.

According git bisect, no idea how:

Fixes 8a2e7ce976fd ("net/ixgbe: avoid multiple definitions of bool")

---
Cc: [email protected]
---
drivers/net/ixgbe/ixgbe_rxtx.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
index 13b06eb9c..30f890572 100644
@@ -2028,7 +2028,7 @@ ixgbe_recv_pkts_lro(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts,
 		bool eop;
 		struct ixgbe_rx_entry *rxe;
 		struct ixgbe_scattered_rx_entry *sc_entry;
-		struct ixgbe_scattered_rx_entry *next_sc_entry;
+		struct ixgbe_scattered_rx_entry *next_sc_entry = NULL;
 		struct ixgbe_rx_entry *next_rxe = NULL;
 		struct rte_mbuf *first_seg;
 		struct rte_mbuf *rxm;
Signature · 1 line
2.24.1
author Applied
#3 lore raw
Quoted 34 lines · Ye Xiaolong
Quoted 33 lines · Ferruh Yigit

Build error:
In function ‘ixgbe_recv_pkts_lro_bulk_alloc’:
../drivers/net/ixgbe/ixgbe_rxtx.c:2209:24:
error: ‘next_sc_entry’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

   next_sc_entry->fbuf = first_seg;
                       ^

http://mails.dpdk.org/archives/test-report/2020-January/113891.html

This is a compiler false positive and error not seen by newer compilers, or clang but to fix the warning initializing the complained variable.

According git bisect, no idea how:

Fixes 8a2e7ce976fd ("net/ixgbe: avoid multiple definitions of bool")

---
Cc: [email protected]
---
drivers/net/ixgbe/ixgbe_rxtx.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
index 13b06eb9c..30f890572 100644
@@ -2028,7 +2028,7 @@ ixgbe_recv_pkts_lro(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts,
 		bool eop;
 		struct ixgbe_rx_entry *rxe;
 		struct ixgbe_scattered_rx_entry *sc_entry;
-		struct ixgbe_scattered_rx_entry *next_sc_entry;
+		struct ixgbe_scattered_rx_entry *next_sc_entry = NULL;
Quoted 9 lines
Quoted 6 lines
drivers/net/ixgbe/ixgbe_rxtx.c +0 -0
 		struct ixgbe_rx_entry *next_rxe = NULL;
 		struct rte_mbuf *first_seg;
 		struct rte_mbuf *rxm;
Signature · 1 line
2.24.1

Applied to dpdk-next-net/master, thanks.