Skip to contentSkip to conversation

build: add unused parameter warnings to meson build

PATCH Applied Bruce Richardson 3 participants 3 messages May 15, 2019 – Jun 3, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: add unused parameter warnings to meson build

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.

---
 config/meson.build                 | 1 +
 drivers/net/i40e/base/meson.build  | 3 ++-
 drivers/net/ice/base/meson.build   | 1 +
 drivers/net/ixgbe/base/meson.build | 4 +++-
 4 files changed, 7 insertions(+), 2 deletions(-)
config/meson.build +1 -0
index 0d25646f5..dbdfde6b8 100644
@@ -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'
drivers/net/i40e/base/meson.build +2 -1
index d4c8f872d..13d16b08d 100644
@@ -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
drivers/net/ice/base/meson.build +1 -0
index 624202567..eff155574 100644
@@ -16,6 +16,7 @@ sources = [
 error_cflags = ['-Wno-unused-value',
 		'-Wno-unused-but-set-variable',
 		'-Wno-unused-variable',
+		'-Wno-unused-parameter',
 ]
 c_args = cflags
 
drivers/net/ixgbe/base/meson.build +3 -1
index 21ac64bf5..bbd0f51ea 100644
@@ -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'
Signature · 1 line
2.21.0
Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · Bruce Richardson

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 <
[email protected]

Quoted 1 line
Quoted 6 lines
---
 config/meson.build                 | 1 +
 drivers/net/i40e/base/meson.build  | 3 ++-
 drivers/net/ice/base/meson.build   | 1 +
 drivers/net/ixgbe/base/meson.build | 4 +++-
 4 files changed, 7 insertions(+), 2 deletions(-)
Signature · 2 lines
Kind regards,
Luca Boccassi
#2 lore raw

15/05/2019 16:39, Luca Boccassi:

Quoted 10 lines · Bruce Richardson
Quoted 9 lines

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.

Quoted 4 lines
Quoted 2 lines

Signed-off-by: Bruce Richardson <
[email protected]

Applied, thanks