[dpdk-dev] kni: fix compilation with gcc 6.1

Message ID 1466692704-2811-1-git-send-email-pablo.de.lara.guarch@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Commit Message

De Lara Guarch, Pablo June 23, 2016, 2:38 p.m. UTC
  Using gcc 6.1, in some cases, kni fails to compile
because of unused variables:

build/lib/librte_eal/linuxapp/kni/ixgbe_main.c:82:19:
error: ‘ixgbe_copyright’
defined but not used [-Werror=unused-const-variable=]
static const char ixgbe_copyright[] =
                   ^~~~~~~~~~~~~~~

build/lib/librte_eal/linuxapp/kni/ixgbe_main.c:62:19:
error: ‘ixgbe_driver_string’
defined but not used [-Werror=unused-const-variable=]
static const char ixgbe_driver_string[] =

Fixes: 3fc5ca2f6352 ("kni: initial import")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c | 4 ----
 1 file changed, 4 deletions(-)
  

Comments

Thomas Monjalon June 23, 2016, 2:59 p.m. UTC | #1
2016-06-23 15:38, Pablo de Lara:
> Using gcc 6.1, in some cases, kni fails to compile
> because of unused variables:

Curiosity: is it only with gcc 6.1? Have you tested other versions?

>  lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c | 4 ----
>  1 file changed, 4 deletions(-)

We all know that the most efficient patch would be to drop the directory
lib/librte_eal/linuxapp/kni/ethtool/ ;)
  
De Lara Guarch, Pablo June 23, 2016, 4:45 p.m. UTC | #2
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Thursday, June 23, 2016 3:59 PM
> To: De Lara Guarch, Pablo
> Cc: dev@dpdk.org; Zhang, Helin
> Subject: Re: [dpdk-dev] [PATCH] kni: fix compilation with gcc 6.1
> 
> 2016-06-23 15:38, Pablo de Lara:
> > Using gcc 6.1, in some cases, kni fails to compile
> > because of unused variables:
> 
> Curiosity: is it only with gcc 6.1? Have you tested other versions?

I have tested it with other gcc versions, but have not seen it there.
I said some cases because depending on the kernel, the flags passed to gcc change,
and if -Wno-unused-const-variable is not passed, then this error shows up.

> 
> >  lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c | 4 ----
> >  1 file changed, 4 deletions(-)
> 
> We all know that the most efficient patch would be to drop the directory
> lib/librte_eal/linuxapp/kni/ethtool/ ;)
  
Ferruh Yigit June 24, 2016, 8:28 a.m. UTC | #3
On 6/23/2016 3:38 PM, Pablo de Lara wrote:
> Using gcc 6.1, in some cases, kni fails to compile
> because of unused variables:
> 
> build/lib/librte_eal/linuxapp/kni/ixgbe_main.c:82:19:
> error: ‘ixgbe_copyright’
> defined but not used [-Werror=unused-const-variable=]
> static const char ixgbe_copyright[] =
>                    ^~~~~~~~~~~~~~~
> 
> build/lib/librte_eal/linuxapp/kni/ixgbe_main.c:62:19:
> error: ‘ixgbe_driver_string’
> defined but not used [-Werror=unused-const-variable=]
> static const char ixgbe_driver_string[] =
> 
> Fixes: 3fc5ca2f6352 ("kni: initial import")
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
  
Thomas Monjalon June 27, 2016, 10:18 a.m. UTC | #4
2016-06-24 09:28, Ferruh Yigit:
> On 6/23/2016 3:38 PM, Pablo de Lara wrote:
> > Using gcc 6.1, in some cases, kni fails to compile
> > because of unused variables:
> > 
> > build/lib/librte_eal/linuxapp/kni/ixgbe_main.c:82:19:
> > error: ‘ixgbe_copyright’
> > defined but not used [-Werror=unused-const-variable=]
> > static const char ixgbe_copyright[] =
> >                    ^~~~~~~~~~~~~~~
> > 
> > build/lib/librte_eal/linuxapp/kni/ixgbe_main.c:62:19:
> > error: ‘ixgbe_driver_string’
> > defined but not used [-Werror=unused-const-variable=]
> > static const char ixgbe_driver_string[] =
> > 
> > Fixes: 3fc5ca2f6352 ("kni: initial import")
> > 
> > Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> 
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied, thanks
  

Patch

diff --git a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c
index 8c1d2fe..92fc9fc 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c
+++ b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_main.c
@@ -59,8 +59,6 @@ 
 #undef CONFIG_DCA_MODULE
 
 char ixgbe_driver_name[] = "ixgbe";
-static const char ixgbe_driver_string[] =
-			      "Intel(R) 10 Gigabit PCI Express Network Driver";
 #define DRV_HW_PERF
 
 #ifndef CONFIG_IXGBE_NAPI
@@ -79,8 +77,6 @@  static const char ixgbe_driver_string[] =
 #define DRV_VERSION	__stringify(MAJ) "." __stringify(MIN) "." \
 			__stringify(BUILD) DRIVERNAPI DRV_HW_PERF FPGA VMDQ_TAG
 const char ixgbe_driver_version[] = DRV_VERSION;
-static const char ixgbe_copyright[] =
-				"Copyright (c) 1999-2012 Intel Corporation.";
 
 /* ixgbe_pci_tbl - PCI Device ID Table
  *