From 47cce54ba8539d6a7569ecb9a4fbcddadc93c7a8 Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Mon, 7 Oct 2019 15:30:10 +0100 Subject: [PATCH] build: allow stricter fallthrough warnings 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 Acked-by: Luca Boccassi --- 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 a2d13d95c4..1e38cbf675 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -2439,7 +2439,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 5525cdc82c..9e1022fefe 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 182ac12f02..478f181b44 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.20.1