summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Richardson <bruce.richardson@intel.com>2019-10-07 15:30:12 +0100
committerThomas Monjalon <thomas@monjalon.net>2019-10-24 01:03:30 +0200
commit524a0d5d66b9a54242623aab9ace9ce4a7ec1347 (patch)
treecfd8011ef37f616eb40f9a69094251636fea334f
parentf20056387df28535fd72d40e007c9752bfdad84a (diff)
downloaddpdk-524a0d5d66b9a54242623aab9ace9ce4a7ec1347.zip
dpdk-524a0d5d66b9a54242623aab9ace9ce4a7ec1347.tar.gz
dpdk-524a0d5d66b9a54242623aab9ace9ce4a7ec1347.tar.xz
build: enable extra warnings with meson
While meson always adds -Wall flag to C compiles, the make build adds extra warning flags that are not present in the meson build. This addresses that shortcoming by adding additional warning flags to our builds. The one omission is the -Wcast-align flag, which though present in make gcc builds, gives a lot of warnings/errors when used with clang. The removed warning "-Wunused-parameter" is covered by the "-Wextra" parameter so is unnecessary. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Luca Boccassi <bluca@debian.org>
-rw-r--r--config/meson.build24
-rw-r--r--drivers/bus/dpaa/meson.build3
-rw-r--r--drivers/event/dsw/meson.build3
-rw-r--r--drivers/net/dpaa/meson.build4
-rw-r--r--drivers/net/i40e/base/meson.build3
5 files changed, 33 insertions, 4 deletions
diff --git a/config/meson.build b/config/meson.build
index a27f731..acacba7 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -142,10 +142,28 @@ add_project_arguments('-include', 'rte_config.h', language: 'c')
# enable extra warnings and disable any unwanted warnings
warning_flags = [
- '-Wunused-parameter',
- '-Wsign-compare',
+ # -Wall is added by meson by default, so add -Wextra only
+ '-Wextra',
+
+ # additional warnings in alphabetical order
'-Wcast-qual',
- '-Wno-address-of-packed-member'
+ '-Wdeprecated',
+ '-Wformat-nonliteral',
+ '-Wformat-security',
+ '-Wmissing-declarations',
+ '-Wmissing-prototypes',
+ '-Wnested-externs',
+ '-Wold-style-definition',
+ '-Wpointer-arith',
+ '-Wsign-compare',
+ '-Wstrict-prototypes',
+ '-Wundef',
+ '-Wwrite-strings',
+
+ # globally disabled warnings
+ '-Wno-address-of-packed-member',
+ '-Wno-packed-not-aligned',
+ '-Wno-missing-field-initializers'
]
if not dpdk_conf.get('RTE_ARCH_64')
# for 32-bit, don't warn about casting a 32-bit pointer to 64-bit int - it's fine!!
diff --git a/drivers/bus/dpaa/meson.build b/drivers/bus/dpaa/meson.build
index 19daaa5..c9c3b24 100644
--- a/drivers/bus/dpaa/meson.build
+++ b/drivers/bus/dpaa/meson.build
@@ -27,5 +27,8 @@ allow_experimental_apis = true
if cc.has_argument('-Wno-cast-qual')
cflags += '-Wno-cast-qual'
endif
+if cc.has_argument('-Wno-pointer-arith')
+ cflags += '-Wno-pointer-arith'
+endif
includes += include_directories('include', 'base/qbman')
diff --git a/drivers/event/dsw/meson.build b/drivers/event/dsw/meson.build
index a3d09ee..60ab13d 100644
--- a/drivers/event/dsw/meson.build
+++ b/drivers/event/dsw/meson.build
@@ -2,4 +2,7 @@
# Copyright(c) 2018 Ericsson AB
deps += ['bus_vdev']
+if cc.has_argument('-Wno-format-nonliteral')
+ cflags += '-Wno-format-nonliteral'
+endif
sources = files('dsw_evdev.c', 'dsw_event.c', 'dsw_xstats.c')
diff --git a/drivers/net/dpaa/meson.build b/drivers/net/dpaa/meson.build
index 94c0e22..542b44a 100644
--- a/drivers/net/dpaa/meson.build
+++ b/drivers/net/dpaa/meson.build
@@ -10,6 +10,10 @@ deps += ['mempool_dpaa']
sources = files('dpaa_ethdev.c',
'dpaa_rxtx.c')
+if cc.has_argument('-Wno-pointer-arith')
+ cflags += '-Wno-pointer-arith'
+endif
+
allow_experimental_apis = true
install_headers('rte_pmd_dpaa.h')
diff --git a/drivers/net/i40e/base/meson.build b/drivers/net/i40e/base/meson.build
index 13d16b0..3dee8c9 100644
--- a/drivers/net/i40e/base/meson.build
+++ b/drivers/net/i40e/base/meson.build
@@ -12,7 +12,8 @@ sources = [
]
error_cflags = ['-Wno-sign-compare', '-Wno-unused-value',
- '-Wno-format', '-Wno-error=format-security',
+ '-Wno-format', '-Wno-format-security',
+ '-Wno-format-nonliteral',
'-Wno-strict-aliasing', '-Wno-unused-but-set-variable',
'-Wno-unused-parameter',
]