[dpdk-dev] [PATCH v2 1/2] ixgbe: fix build with gcc 4.4

Vlad Zolotarov vladz at cloudius-systems.com
Thu Apr 16 11:35:43 CEST 2015



On 04/16/15 12:18, Thomas Monjalon wrote:
> 2015-04-16 12:14, Vlad Zolotarov:
>> On 04/15/15 23:49, Thomas Monjalon wrote:
>>> The "may be used uninitialized" warning seems to be another GCC bug and is
>>> workarounded with NULL initialization.
>>> --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
>>> +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
>>> @@ -1476,8 +1476,8 @@ 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_rsc_entry *rsc_entry;
>>> -		struct ixgbe_rsc_entry *next_rsc_entry;
>>> -		struct ixgbe_rx_entry *next_rxe;
>>> +		struct ixgbe_rsc_entry *next_rsc_entry = NULL;
>>> +		struct ixgbe_rx_entry *next_rxe = NULL;
>> -Wno-maybe-uninitialized ?
> I prefer avoiding this flag for 2 reasons:
> 	- It's not supported in every GCC versions (need special handling)

Is it supported for 4.4? U don't have to support all ever existed gcc 
versions. ;)

> 	- NULL assigment doesn't hurt

Right, but still it's ugly since it's clear that it's a workaround - 
right above the patched ones there are variables that are not 
initialized and this discloses the workaround... ;)

>



More information about the dev mailing list