build: warn on unused parameter
authorBruce Richardson <bruce.richardson@intel.com>
Wed, 15 May 2019 11:38:47 +0000 (12:38 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 3 Jun 2019 22:22:50 +0000 (00:22 +0200)
To improve code quality we want to turn on as many warnings as we can in
the DPDK code, so turn on the "unused-parameter" warning in meson builds to
match that of the make builds. To ensure correct compilation, disable the
warning selectively for driver base code that otherwise would have issues.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
config/meson.build
drivers/net/i40e/base/meson.build
drivers/net/ice/base/meson.build
drivers/net/ixgbe/base/meson.build

index 0d25646..dbdfde6 100644 (file)
@@ -143,6 +143,7 @@ add_project_arguments('-include', 'rte_config.h', language: 'c')
 
 # enable extra warnings and disable any unwanted warnings
 warning_flags = [
+       '-Wunused-parameter',
        '-Wsign-compare',
        '-Wcast-qual',
        '-Wno-address-of-packed-member'
index d4c8f87..13d16b0 100644 (file)
@@ -13,7 +13,8 @@ sources = [
 
 error_cflags = ['-Wno-sign-compare', '-Wno-unused-value',
                '-Wno-format', '-Wno-error=format-security',
-               '-Wno-strict-aliasing', '-Wno-unused-but-set-variable'
+               '-Wno-strict-aliasing', '-Wno-unused-but-set-variable',
+               '-Wno-unused-parameter',
 ]
 c_args = cflags
 if allow_experimental_apis
index 6242025..eff1555 100644 (file)
@@ -16,6 +16,7 @@ sources = [
 error_cflags = ['-Wno-unused-value',
                '-Wno-unused-but-set-variable',
                '-Wno-unused-variable',
+               '-Wno-unused-parameter',
 ]
 c_args = cflags
 
index 21ac64b..bbd0f51 100644 (file)
@@ -18,7 +18,9 @@ sources = [
 ]
 
 error_cflags = ['-Wno-unused-value',
-               '-Wno-unused-but-set-variable']
+               '-Wno-unused-but-set-variable',
+               '-Wno-unused-parameter',
+               ]
 c_args = cflags
 if allow_experimental_apis
        c_args += '-DALLOW_EXPERIMENTAL_API'