[dpdk-dev] [PATCH] ixgbe: fix build with gcc 5

Ananyev, Konstantin konstantin.ananyev at intel.com
Thu Feb 19 13:02:06 CET 2015


Hi Panu,

> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Panu Matilainen
> Sent: Thursday, February 19, 2015 10:25 AM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH] ixgbe: fix build with gcc 5
> 
> Add extra parenthesis to remove ambiguity on what we want to compare,
> otherwise gcc 5 issues a "logical not is only applied to the left hand
> side of comparison" warning which with -Werror fails the build.
> 
> Signed-off-by: Panu Matilainen <pmatilai at redhat.com>
> ---
>  lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c
> index 37e5bae..93a6a00 100644
> --- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c
> +++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c
> @@ -2898,8 +2898,8 @@ STATIC s32 ixgbe_fc_autoneg_fiber(struct ixgbe_hw *hw)
>  	 */
> 
>  	linkstat = IXGBE_READ_REG(hw, IXGBE_PCS1GLSTA);
> -	if ((!!(linkstat & IXGBE_PCS1GLSTA_AN_COMPLETE) == 0) ||
> -	    (!!(linkstat & IXGBE_PCS1GLSTA_AN_TIMED_OUT) == 1)) {
> +	if (((!!(linkstat & IXGBE_PCS1GLSTA_AN_COMPLETE)) == 0) ||
> +	    ((!!(linkstat & IXGBE_PCS1GLSTA_AN_TIMED_OUT)) == 1)) {
>  		ERROR_REPORT1(IXGBE_ERROR_POLLING,
>  			     "Auto-Negotiation did not complete or timed out");
>  		goto out;

Unfortunately we are not supposed to change files under ixgbe subfirectory (except ixgbe_osdep.*).
Usually we deal with it just by:
If GCC_VERSION...
CFLAGS_ixgbe_common.o += -Wno...

You can have a look at lib/librte_pmd_ixgbe/Makefile, there are plenty of such things.
Konstantin


> --
> 2.1.0



More information about the dev mailing list