* [dpdk-dev] [PATCH 19.11 1/4] build: allow compile with stricter fallthrough warnings
2019-07-25 14:38 [dpdk-dev] [PATCH 19.11 0/4] synchronise meson warnings with make Bruce Richardson
@ 2019-07-25 14:38 ` Bruce Richardson
2019-07-25 14:38 ` [dpdk-dev] [PATCH 19.11 2/4] raw/ifpga: remove unneeded compiler flags Bruce Richardson
` (4 subsequent siblings)
5 siblings, 0 replies; 12+ messages in thread
From: Bruce Richardson @ 2019-07-25 14:38 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
DPDK currently compiles with implicit-fallthrough=2 warning level. With gcc
-Wextra flag, the default level is 3, so some minor changes are needed to
support this in DPDK.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
drivers/net/bonding/rte_eth_bond_pmd.c | 3 ++-
drivers/net/fm10k/base/meson.build | 3 ++-
lib/librte_cmdline/cmdline_parse_num.c | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 6a6ed890a..728915d4a 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -2521,7 +2521,8 @@ bond_ethdev_link_update(struct rte_eth_dev *ethdev, int wait_to_complete)
bond_ctx->mode4.slave_link.link_autoneg;
ethdev->data->dev_link.link_duplex =
bond_ctx->mode4.slave_link.link_duplex;
- /* fall through to update link speed */
+ /* fall through */
+ /* to update link speed */
case BONDING_MODE_ROUND_ROBIN:
case BONDING_MODE_BALANCE:
case BONDING_MODE_TLB:
diff --git a/drivers/net/fm10k/base/meson.build b/drivers/net/fm10k/base/meson.build
index 5525cdc82..9e1022fef 100644
--- a/drivers/net/fm10k/base/meson.build
+++ b/drivers/net/fm10k/base/meson.build
@@ -12,7 +12,8 @@ sources = [
error_cflags = ['-Wno-unused-parameter', '-Wno-unused-value',
'-Wno-strict-aliasing', '-Wno-format-extra-args',
- '-Wno-unused-variable', '-Wno-missing-field-initializers'
+ '-Wno-unused-variable', '-Wno-missing-field-initializers',
+ '-Wno-implicit-fallthrough'
]
c_args = cflags
if allow_experimental_apis
diff --git a/lib/librte_cmdline/cmdline_parse_num.c b/lib/librte_cmdline/cmdline_parse_num.c
index 182ac12f0..478f181b4 100644
--- a/lib/librte_cmdline/cmdline_parse_num.c
+++ b/lib/librte_cmdline/cmdline_parse_num.c
@@ -196,7 +196,7 @@ cmdline_parse_num(cmdline_parse_token_hdr_t *tk, const char *srcbuf, void *res,
case HEX:
st = HEX_OK;
- /* fall-through no break */
+ /* fall-through */
case HEX_OK:
if (c >= '0' && c <= '9') {
if (add_to_res(c - '0', &res1, 16) < 0)
--
2.21.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH 19.11 2/4] raw/ifpga: remove unneeded compiler flags
2019-07-25 14:38 [dpdk-dev] [PATCH 19.11 0/4] synchronise meson warnings with make Bruce Richardson
2019-07-25 14:38 ` [dpdk-dev] [PATCH 19.11 1/4] build: allow compile with stricter fallthrough warnings Bruce Richardson
@ 2019-07-25 14:38 ` Bruce Richardson
2019-07-25 14:38 ` [dpdk-dev] [PATCH 19.11 3/4] build: enable extra warnings for meson build Bruce Richardson
` (3 subsequent siblings)
5 siblings, 0 replies; 12+ messages in thread
From: Bruce Richardson @ 2019-07-25 14:38 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
The warning disable flags for the base driver code were copy-pasted from
another source, and are actually unnecessary for this driver. Therefore
remove them.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
drivers/raw/ifpga_rawdev/base/meson.build | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/drivers/raw/ifpga_rawdev/base/meson.build b/drivers/raw/ifpga_rawdev/base/meson.build
index f1015bbee..69f659886 100644
--- a/drivers/raw/ifpga_rawdev/base/meson.build
+++ b/drivers/raw/ifpga_rawdev/base/meson.build
@@ -23,17 +23,6 @@ sources = [
'opae_eth_group.c',
]
-error_cflags = ['-Wno-sign-compare', '-Wno-unused-value',
- '-Wno-format', '-Wno-error=format-security',
- '-Wno-strict-aliasing', '-Wno-unused-but-set-variable'
-]
-c_args = cflags
-foreach flag: error_cflags
- if cc.has_argument(flag)
- c_args += flag
- endif
-endforeach
-
base_lib = static_library('ifpga_rawdev_base', sources,
dependencies: static_rte_eal,
c_args: c_args)
--
2.21.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH 19.11 3/4] build: enable extra warnings for meson build
2019-07-25 14:38 [dpdk-dev] [PATCH 19.11 0/4] synchronise meson warnings with make Bruce Richardson
2019-07-25 14:38 ` [dpdk-dev] [PATCH 19.11 1/4] build: allow compile with stricter fallthrough warnings Bruce Richardson
2019-07-25 14:38 ` [dpdk-dev] [PATCH 19.11 2/4] raw/ifpga: remove unneeded compiler flags Bruce Richardson
@ 2019-07-25 14:38 ` Bruce Richardson
2019-07-25 14:38 ` [dpdk-dev] [PATCH 19.11 4/4] drivers: remove duplicated compiler flags Bruce Richardson
` (2 subsequent siblings)
5 siblings, 0 replies; 12+ messages in thread
From: Bruce Richardson @ 2019-07-25 14:38 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
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>
---
config/meson.build | 24 +++++++++++++++++++++---
drivers/bus/dpaa/meson.build | 3 +++
drivers/event/dsw/meson.build | 3 +++
drivers/net/dpaa/meson.build | 4 ++++
drivers/net/i40e/base/meson.build | 3 ++-
5 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/config/meson.build b/config/meson.build
index 2bafea530..6918a9ecc 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -143,10 +143,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 19daaa5b5..c9c3b2415 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 a3d09eef3..60ab13d90 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 94c0e22c5..542b44af4 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 13d16b08d..3dee8c975 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',
]
--
2.21.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH 19.11 4/4] drivers: remove duplicated compiler flags
2019-07-25 14:38 [dpdk-dev] [PATCH 19.11 0/4] synchronise meson warnings with make Bruce Richardson
` (2 preceding siblings ...)
2019-07-25 14:38 ` [dpdk-dev] [PATCH 19.11 3/4] build: enable extra warnings for meson build Bruce Richardson
@ 2019-07-25 14:38 ` Bruce Richardson
2019-10-07 14:17 ` [dpdk-dev] [PATCH 19.11 0/4] synchronise meson warnings with make Luca Boccassi
2019-10-07 14:30 ` [dpdk-dev] [PATCH v2 " Bruce Richardson
5 siblings, 0 replies; 12+ messages in thread
From: Bruce Richardson @ 2019-07-25 14:38 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
Now that -Wextra, and other warning flags are standard in the build, remove
any duplication in driver build specifications.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
drivers/net/fm10k/base/meson.build | 2 +-
drivers/net/mlx4/meson.build | 1 -
drivers/net/mlx5/meson.build | 1 -
drivers/net/sfc/meson.build | 2 --
drivers/net/vdev_netvsc/meson.build | 2 --
5 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/net/fm10k/base/meson.build b/drivers/net/fm10k/base/meson.build
index 9e1022fef..40d9b730a 100644
--- a/drivers/net/fm10k/base/meson.build
+++ b/drivers/net/fm10k/base/meson.build
@@ -12,7 +12,7 @@ sources = [
error_cflags = ['-Wno-unused-parameter', '-Wno-unused-value',
'-Wno-strict-aliasing', '-Wno-format-extra-args',
- '-Wno-unused-variable', '-Wno-missing-field-initializers',
+ '-Wno-unused-variable',
'-Wno-implicit-fallthrough'
]
c_args = cflags
diff --git a/drivers/net/mlx4/meson.build b/drivers/net/mlx4/meson.build
index 028cd97fa..2870e5ef7 100644
--- a/drivers/net/mlx4/meson.build
+++ b/drivers/net/mlx4/meson.build
@@ -55,7 +55,6 @@ if build
sources += files('mlx4_glue.c')
endif
cflags_options = [
- '-Wextra',
'-std=c11',
'-Wno-strict-prototypes',
'-D_BSD_SOURCE',
diff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build
index 62b41caf1..ed8527125 100644
--- a/drivers/net/mlx5/meson.build
+++ b/drivers/net/mlx5/meson.build
@@ -66,7 +66,6 @@ if build
sources += files('mlx5_glue.c')
endif
cflags_options = [
- '-Wextra',
'-std=c11',
'-Wno-strict-prototypes',
'-D_BSD_SOURCE',
diff --git a/drivers/net/sfc/meson.build b/drivers/net/sfc/meson.build
index 4fb0d0ac1..8c54f9d54 100644
--- a/drivers/net/sfc/meson.build
+++ b/drivers/net/sfc/meson.build
@@ -20,14 +20,12 @@ extra_flags += '-Wno-strict-aliasing'
# Enable more warnings
extra_flags += [
- '-Wextra',
'-Wdisabled-optimization'
]
# Compiler and version dependent flags
extra_flags += [
'-Waggregate-return',
- '-Wnested-externs',
'-Wbad-function-cast'
]
diff --git a/drivers/net/vdev_netvsc/meson.build b/drivers/net/vdev_netvsc/meson.build
index c82c5476c..bf62edb7a 100644
--- a/drivers/net/vdev_netvsc/meson.build
+++ b/drivers/net/vdev_netvsc/meson.build
@@ -10,8 +10,6 @@ sources = files('vdev_netvsc.c')
allow_experimental_apis = true
cflags_options = [
- '-Wall',
- '-Wextra',
'-D_BSD_SOURCE',
'-D_DEFAULT_SOURCE',
'-D_XOPEN_SOURCE=600'
--
2.21.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH 19.11 0/4] synchronise meson warnings with make
2019-07-25 14:38 [dpdk-dev] [PATCH 19.11 0/4] synchronise meson warnings with make Bruce Richardson
` (3 preceding siblings ...)
2019-07-25 14:38 ` [dpdk-dev] [PATCH 19.11 4/4] drivers: remove duplicated compiler flags Bruce Richardson
@ 2019-10-07 14:17 ` Luca Boccassi
2019-10-07 14:30 ` [dpdk-dev] [PATCH v2 " Bruce Richardson
5 siblings, 0 replies; 12+ messages in thread
From: Luca Boccassi @ 2019-10-07 14:17 UTC (permalink / raw)
To: Bruce Richardson, dev
On Thu, 2019-07-25 at 15:38 +0100, Bruce Richardson wrote:
> The warnings used when building DPDK with make were stricter than
> those
> used with meson, so this patchset aligns the two as far as is
> possible,
> while also adding in -Wextra as a general compile flag.
>
> The one difference is that with "make" we allow different flags for
> GCC
> and clang, while with meson we are (for now) keeping them common.
> Therefore we drop the -Wcast-align flag as is generates too many
> false positive warnings on clang, and we globally use the
> Wno-missing-field-initializers flag for the same reason.
>
> Bruce Richardson (4):
> build: allow compile with stricter fallthrough warnings
> raw/ifpga: remove unneeded compiler flags
> build: enable extra warnings for meson build
> drivers: remove duplicated compiler flags
>
> config/meson.build | 24 ++++++++++++++++++++-
> --
> drivers/bus/dpaa/meson.build | 3 +++
> drivers/event/dsw/meson.build | 3 +++
> drivers/net/bonding/rte_eth_bond_pmd.c | 3 ++-
> drivers/net/dpaa/meson.build | 4 ++++
> drivers/net/fm10k/base/meson.build | 3 ++-
> drivers/net/i40e/base/meson.build | 3 ++-
> drivers/net/mlx4/meson.build | 1 -
> drivers/net/mlx5/meson.build | 1 -
> drivers/net/sfc/meson.build | 2 --
> drivers/net/vdev_netvsc/meson.build | 2 --
> drivers/raw/ifpga_rawdev/base/meson.build | 11 -----------
> lib/librte_cmdline/cmdline_parse_num.c | 2 +-
> 13 files changed, 38 insertions(+), 24 deletions(-)
Series-acked-by: Luca Boccassi <bluca@debian.org>
--
Kind regards,
Luca Boccassi
^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH v2 0/4] synchronise meson warnings with make
2019-07-25 14:38 [dpdk-dev] [PATCH 19.11 0/4] synchronise meson warnings with make Bruce Richardson
` (4 preceding siblings ...)
2019-10-07 14:17 ` [dpdk-dev] [PATCH 19.11 0/4] synchronise meson warnings with make Luca Boccassi
@ 2019-10-07 14:30 ` Bruce Richardson
2019-10-07 14:30 ` [dpdk-dev] [PATCH v2 1/4] build: allow compile with stricter fallthrough warnings Bruce Richardson
` (4 more replies)
5 siblings, 5 replies; 12+ messages in thread
From: Bruce Richardson @ 2019-10-07 14:30 UTC (permalink / raw)
To: dev; +Cc: bluca, Bruce Richardson
The warnings used when building DPDK with make were stricter than those
used with meson, so this patchset aligns the two as far as is possible,
while also adding in -Wextra as a general compile flag.
The one difference is that with "make" we allow different flags for GCC
and clang, while with meson we are (for now) keeping them common.
Therefore we drop the -Wcast-align flag as is generates too many
false positive warnings on clang, and we globally use the
Wno-missing-field-initializers flag for the same reason.
v2: fix path to ifpga driver in patch 2, since it has moved in the repo
Bruce Richardson (4):
build: allow compile with stricter fallthrough warnings
raw/ifpga: remove unneeded compiler flags
build: enable extra warnings for meson build
drivers: remove duplicated compiler flags
config/meson.build | 24 +++++++++++++++++++++---
drivers/bus/dpaa/meson.build | 3 +++
drivers/event/dsw/meson.build | 3 +++
drivers/net/bonding/rte_eth_bond_pmd.c | 3 ++-
drivers/net/dpaa/meson.build | 4 ++++
drivers/net/fm10k/base/meson.build | 3 ++-
drivers/net/i40e/base/meson.build | 3 ++-
drivers/net/mlx4/meson.build | 1 -
drivers/net/mlx5/meson.build | 1 -
drivers/net/sfc/meson.build | 2 --
drivers/net/vdev_netvsc/meson.build | 2 --
drivers/raw/ifpga/base/meson.build | 11 -----------
lib/librte_cmdline/cmdline_parse_num.c | 2 +-
13 files changed, 38 insertions(+), 24 deletions(-)
--
2.21.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH v2 1/4] build: allow compile with stricter fallthrough warnings
2019-10-07 14:30 ` [dpdk-dev] [PATCH v2 " Bruce Richardson
@ 2019-10-07 14:30 ` Bruce Richardson
2019-10-07 14:30 ` [dpdk-dev] [PATCH v2 2/4] raw/ifpga: remove unneeded compiler flags Bruce Richardson
` (3 subsequent siblings)
4 siblings, 0 replies; 12+ messages in thread
From: Bruce Richardson @ 2019-10-07 14:30 UTC (permalink / raw)
To: dev; +Cc: bluca, Bruce Richardson
DPDK currently compiles with implicit-fallthrough=2 warning level. With gcc
-Wextra flag, the default level is 3, so some minor changes are needed to
support this in DPDK.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
---
drivers/net/bonding/rte_eth_bond_pmd.c | 3 ++-
drivers/net/fm10k/base/meson.build | 3 ++-
lib/librte_cmdline/cmdline_parse_num.c | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 97ab3f29f..a28827b35 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -2385,7 +2385,8 @@ bond_ethdev_link_update(struct rte_eth_dev *ethdev, int wait_to_complete)
bond_ctx->mode4.slave_link.link_autoneg;
ethdev->data->dev_link.link_duplex =
bond_ctx->mode4.slave_link.link_duplex;
- /* fall through to update link speed */
+ /* fall through */
+ /* to update link speed */
case BONDING_MODE_ROUND_ROBIN:
case BONDING_MODE_BALANCE:
case BONDING_MODE_TLB:
diff --git a/drivers/net/fm10k/base/meson.build b/drivers/net/fm10k/base/meson.build
index 5525cdc82..9e1022fef 100644
--- a/drivers/net/fm10k/base/meson.build
+++ b/drivers/net/fm10k/base/meson.build
@@ -12,7 +12,8 @@ sources = [
error_cflags = ['-Wno-unused-parameter', '-Wno-unused-value',
'-Wno-strict-aliasing', '-Wno-format-extra-args',
- '-Wno-unused-variable', '-Wno-missing-field-initializers'
+ '-Wno-unused-variable', '-Wno-missing-field-initializers',
+ '-Wno-implicit-fallthrough'
]
c_args = cflags
if allow_experimental_apis
diff --git a/lib/librte_cmdline/cmdline_parse_num.c b/lib/librte_cmdline/cmdline_parse_num.c
index 182ac12f0..478f181b4 100644
--- a/lib/librte_cmdline/cmdline_parse_num.c
+++ b/lib/librte_cmdline/cmdline_parse_num.c
@@ -196,7 +196,7 @@ cmdline_parse_num(cmdline_parse_token_hdr_t *tk, const char *srcbuf, void *res,
case HEX:
st = HEX_OK;
- /* fall-through no break */
+ /* fall-through */
case HEX_OK:
if (c >= '0' && c <= '9') {
if (add_to_res(c - '0', &res1, 16) < 0)
--
2.21.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH v2 2/4] raw/ifpga: remove unneeded compiler flags
2019-10-07 14:30 ` [dpdk-dev] [PATCH v2 " Bruce Richardson
2019-10-07 14:30 ` [dpdk-dev] [PATCH v2 1/4] build: allow compile with stricter fallthrough warnings Bruce Richardson
@ 2019-10-07 14:30 ` Bruce Richardson
2019-10-07 14:30 ` [dpdk-dev] [PATCH v2 3/4] build: enable extra warnings for meson build Bruce Richardson
` (2 subsequent siblings)
4 siblings, 0 replies; 12+ messages in thread
From: Bruce Richardson @ 2019-10-07 14:30 UTC (permalink / raw)
To: dev; +Cc: bluca, Bruce Richardson
The warning disable flags for the base driver code were copy-pasted from
another source, and are actually unnecessary for this driver. Therefore
remove them.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
---
drivers/raw/ifpga/base/meson.build | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/drivers/raw/ifpga/base/meson.build b/drivers/raw/ifpga/base/meson.build
index f1015bbee..69f659886 100644
--- a/drivers/raw/ifpga/base/meson.build
+++ b/drivers/raw/ifpga/base/meson.build
@@ -23,17 +23,6 @@ sources = [
'opae_eth_group.c',
]
-error_cflags = ['-Wno-sign-compare', '-Wno-unused-value',
- '-Wno-format', '-Wno-error=format-security',
- '-Wno-strict-aliasing', '-Wno-unused-but-set-variable'
-]
-c_args = cflags
-foreach flag: error_cflags
- if cc.has_argument(flag)
- c_args += flag
- endif
-endforeach
-
base_lib = static_library('ifpga_rawdev_base', sources,
dependencies: static_rte_eal,
c_args: c_args)
--
2.21.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH v2 3/4] build: enable extra warnings for meson build
2019-10-07 14:30 ` [dpdk-dev] [PATCH v2 " Bruce Richardson
2019-10-07 14:30 ` [dpdk-dev] [PATCH v2 1/4] build: allow compile with stricter fallthrough warnings Bruce Richardson
2019-10-07 14:30 ` [dpdk-dev] [PATCH v2 2/4] raw/ifpga: remove unneeded compiler flags Bruce Richardson
@ 2019-10-07 14:30 ` Bruce Richardson
2019-10-07 14:30 ` [dpdk-dev] [PATCH v2 4/4] drivers: remove duplicated compiler flags Bruce Richardson
2019-10-23 21:53 ` [dpdk-dev] [PATCH v2 0/4] synchronise meson warnings with make Thomas Monjalon
4 siblings, 0 replies; 12+ messages in thread
From: Bruce Richardson @ 2019-10-07 14:30 UTC (permalink / raw)
To: dev; +Cc: bluca, Bruce Richardson
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>
---
config/meson.build | 24 +++++++++++++++++++++---
drivers/bus/dpaa/meson.build | 3 +++
drivers/event/dsw/meson.build | 3 +++
drivers/net/dpaa/meson.build | 4 ++++
drivers/net/i40e/base/meson.build | 3 ++-
5 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/config/meson.build b/config/meson.build
index 2bafea530..6918a9ecc 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -143,10 +143,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 19daaa5b5..c9c3b2415 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 a3d09eef3..60ab13d90 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 94c0e22c5..542b44af4 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 13d16b08d..3dee8c975 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',
]
--
2.21.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH v2 4/4] drivers: remove duplicated compiler flags
2019-10-07 14:30 ` [dpdk-dev] [PATCH v2 " Bruce Richardson
` (2 preceding siblings ...)
2019-10-07 14:30 ` [dpdk-dev] [PATCH v2 3/4] build: enable extra warnings for meson build Bruce Richardson
@ 2019-10-07 14:30 ` Bruce Richardson
2019-10-23 21:53 ` [dpdk-dev] [PATCH v2 0/4] synchronise meson warnings with make Thomas Monjalon
4 siblings, 0 replies; 12+ messages in thread
From: Bruce Richardson @ 2019-10-07 14:30 UTC (permalink / raw)
To: dev; +Cc: bluca, Bruce Richardson
Now that -Wextra, and other warning flags are standard in the build, remove
any duplication in driver build specifications.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
---
drivers/net/fm10k/base/meson.build | 2 +-
drivers/net/mlx4/meson.build | 1 -
drivers/net/mlx5/meson.build | 1 -
drivers/net/sfc/meson.build | 2 --
drivers/net/vdev_netvsc/meson.build | 2 --
5 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/net/fm10k/base/meson.build b/drivers/net/fm10k/base/meson.build
index 9e1022fef..40d9b730a 100644
--- a/drivers/net/fm10k/base/meson.build
+++ b/drivers/net/fm10k/base/meson.build
@@ -12,7 +12,7 @@ sources = [
error_cflags = ['-Wno-unused-parameter', '-Wno-unused-value',
'-Wno-strict-aliasing', '-Wno-format-extra-args',
- '-Wno-unused-variable', '-Wno-missing-field-initializers',
+ '-Wno-unused-variable',
'-Wno-implicit-fallthrough'
]
c_args = cflags
diff --git a/drivers/net/mlx4/meson.build b/drivers/net/mlx4/meson.build
index efee45776..873edadac 100644
--- a/drivers/net/mlx4/meson.build
+++ b/drivers/net/mlx4/meson.build
@@ -55,7 +55,6 @@ if build
sources += files('mlx4_glue.c')
endif
cflags_options = [
- '-Wextra',
'-std=c11',
'-Wno-strict-prototypes',
'-D_BSD_SOURCE',
diff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build
index 3c5144c9b..94f92ad6b 100644
--- a/drivers/net/mlx5/meson.build
+++ b/drivers/net/mlx5/meson.build
@@ -66,7 +66,6 @@ if build
sources += files('mlx5_glue.c')
endif
cflags_options = [
- '-Wextra',
'-std=c11',
'-Wno-strict-prototypes',
'-D_BSD_SOURCE',
diff --git a/drivers/net/sfc/meson.build b/drivers/net/sfc/meson.build
index 4fb0d0ac1..8c54f9d54 100644
--- a/drivers/net/sfc/meson.build
+++ b/drivers/net/sfc/meson.build
@@ -20,14 +20,12 @@ extra_flags += '-Wno-strict-aliasing'
# Enable more warnings
extra_flags += [
- '-Wextra',
'-Wdisabled-optimization'
]
# Compiler and version dependent flags
extra_flags += [
'-Waggregate-return',
- '-Wnested-externs',
'-Wbad-function-cast'
]
diff --git a/drivers/net/vdev_netvsc/meson.build b/drivers/net/vdev_netvsc/meson.build
index c82c5476c..bf62edb7a 100644
--- a/drivers/net/vdev_netvsc/meson.build
+++ b/drivers/net/vdev_netvsc/meson.build
@@ -10,8 +10,6 @@ sources = files('vdev_netvsc.c')
allow_experimental_apis = true
cflags_options = [
- '-Wall',
- '-Wextra',
'-D_BSD_SOURCE',
'-D_DEFAULT_SOURCE',
'-D_XOPEN_SOURCE=600'
--
2.21.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH v2 0/4] synchronise meson warnings with make
2019-10-07 14:30 ` [dpdk-dev] [PATCH v2 " Bruce Richardson
` (3 preceding siblings ...)
2019-10-07 14:30 ` [dpdk-dev] [PATCH v2 4/4] drivers: remove duplicated compiler flags Bruce Richardson
@ 2019-10-23 21:53 ` Thomas Monjalon
4 siblings, 0 replies; 12+ messages in thread
From: Thomas Monjalon @ 2019-10-23 21:53 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev, bluca
07/10/2019 16:30, Bruce Richardson:
> The warnings used when building DPDK with make were stricter than those
> used with meson, so this patchset aligns the two as far as is possible,
> while also adding in -Wextra as a general compile flag.
>
> The one difference is that with "make" we allow different flags for GCC
> and clang, while with meson we are (for now) keeping them common.
> Therefore we drop the -Wcast-align flag as is generates too many
> false positive warnings on clang, and we globally use the
> Wno-missing-field-initializers flag for the same reason.
>
> v2: fix path to ifpga driver in patch 2, since it has moved in the repo
>
> Bruce Richardson (4):
> build: allow compile with stricter fallthrough warnings
> raw/ifpga: remove unneeded compiler flags
> build: enable extra warnings for meson build
> drivers: remove duplicated compiler flags
Applied, thanks
^ permalink raw reply [flat|nested] 12+ messages in thread