DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com, bruce.richardson@intel.com,
	Liang Ma <liang.j.ma@intel.com>,
	Peter Mccarthy <peter.mccarthy@intel.com>,
	Harry van Haaren <harry.van.haaren@intel.com>,
	Qi Zhang <qi.z.zhang@intel.com>,
	Xiao Wang <xiao.w.wang@intel.com>,
	Beilei Xing <beilei.xing@intel.com>,
	Alfredo Cardigliano <cardigliano@ntop.org>
Subject: [dpdk-dev] [PATCH] mk: ignore missing field initializers warning
Date: Tue, 21 Jan 2020 15:35:31 +0100	[thread overview]
Message-ID: <20200121143531.2677911-1-thomas@monjalon.net> (raw)

Three warnings are commonly disabled in DPDK with make and meson:
	* address-of-packed-member
		always disabled
	* missing-field-initializers
		disabled with meson
		disabled with make + clang or make + gcc < 4.7
		disabled with make + gcc <= 5 for test files and event drivers
	* packed-not-aligned
		disabled with meson

This change is removing exceptions for missing-field-initializers.
As it is always disabled, some redundant configs are cleaned up.

Now the situation is:
	* address-of-packed-member
		always disabled
	* missing-field-initializers
		always disabled
	* packed-not-aligned
		disabled with meson

It could alternatively be decided to disable missing-field-initializers
only for old gcc (< 6).

The warning packed-not-aligned is not modified in this change.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 app/test/Makefile              |  7 -------
 drivers/event/opdl/Makefile    |  7 -------
 drivers/event/sw/Makefile      |  7 -------
 drivers/net/fm10k/Makefile     |  2 --
 drivers/net/i40e/Makefile      |  2 --
 drivers/net/ionic/Makefile     |  3 ---
 drivers/net/ionic/meson.build  | 10 ----------
 mk/toolchain/clang/rte.vars.mk |  2 +-
 mk/toolchain/gcc/rte.vars.mk   |  4 +---
 9 files changed, 2 insertions(+), 42 deletions(-)

diff --git a/app/test/Makefile b/app/test/Makefile
index 57930c00b1..498008bb78 100644
--- a/app/test/Makefile
+++ b/app/test/Makefile
@@ -258,13 +258,6 @@ ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
 ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1)
 CFLAGS_test_memcpy.o += -fno-var-tracking-assignments
 CFLAGS_test_memcpy_perf.o += -fno-var-tracking-assignments
-# for older GCC versions, allow us to initialize an event using
-# designated initializers.
-ifeq ($(shell test $(GCC_VERSION) -le 50 && echo 1), 1)
-CFLAGS_test_eventdev_sw.o += -Wno-missing-field-initializers
-CFLAGS_test_event_timer_adapter.o += -Wno-missing-field-initializers
-CFLAGS_test_event_crypto_adapter.o += -Wno-missing-field-initializers
-endif
 endif
 endif
 
diff --git a/drivers/event/opdl/Makefile b/drivers/event/opdl/Makefile
index fb87c7d0d4..1dfd6f5e83 100644
--- a/drivers/event/opdl/Makefile
+++ b/drivers/event/opdl/Makefile
@@ -10,13 +10,6 @@ LIB = librte_pmd_opdl_event.a
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 CFLAGS += -DALLOW_EXPERIMENTAL_API
-# for older GCC versions, allow us to initialize an event using
-# designated initializers.
-ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-ifeq ($(shell test $(GCC_VERSION) -le 50 && echo 1), 1)
-CFLAGS += -Wno-missing-field-initializers
-endif
-endif
 
 LDLIBS += -lrte_eal -lrte_eventdev -lrte_kvargs
 LDLIBS += -lrte_bus_vdev -lrte_mbuf -lrte_mempool
diff --git a/drivers/event/sw/Makefile b/drivers/event/sw/Makefile
index 17937e295e..8ea5cceb8b 100644
--- a/drivers/event/sw/Makefile
+++ b/drivers/event/sw/Makefile
@@ -9,13 +9,6 @@ LIB = librte_pmd_sw_event.a
 # build flags
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
-# for older GCC versions, allow us to initialize an event using
-# designated initializers.
-ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-ifeq ($(shell test $(GCC_VERSION) -le 50 && echo 1), 1)
-CFLAGS += -Wno-missing-field-initializers
-endif
-endif
 LDLIBS += -lrte_eal -lrte_eventdev -lrte_kvargs -lrte_ring
 LDLIBS += -lrte_mempool -lrte_mbuf
 LDLIBS += -lrte_bus_vdev
diff --git a/drivers/net/fm10k/Makefile b/drivers/net/fm10k/Makefile
index 722bf1ee04..0271bcb15e 100644
--- a/drivers/net/fm10k/Makefile
+++ b/drivers/net/fm10k/Makefile
@@ -29,7 +29,6 @@ else ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
 CFLAGS_BASE_DRIVER = -Wno-unused-parameter -Wno-unused-value
 CFLAGS_BASE_DRIVER += -Wno-strict-aliasing -Wno-format-extra-args
 CFLAGS_BASE_DRIVER += -Wno-unused-variable
-CFLAGS_BASE_DRIVER += -Wno-missing-field-initializers
 
 else
 #
@@ -38,7 +37,6 @@ else
 CFLAGS_BASE_DRIVER = -Wno-unused-parameter -Wno-unused-value
 CFLAGS_BASE_DRIVER += -Wno-strict-aliasing -Wno-format-extra-args
 CFLAGS_BASE_DRIVER += -Wno-unused-variable
-CFLAGS_BASE_DRIVER += -Wno-missing-field-initializers
 
 ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1)
 CFLAGS     += -Wno-deprecated
diff --git a/drivers/net/i40e/Makefile b/drivers/net/i40e/Makefile
index 435eb511ad..819473abac 100644
--- a/drivers/net/i40e/Makefile
+++ b/drivers/net/i40e/Makefile
@@ -31,7 +31,6 @@ CFLAGS_BASE_DRIVER += -Wno-unused-value
 CFLAGS_BASE_DRIVER += -Wno-unused-parameter
 CFLAGS_BASE_DRIVER += -Wno-strict-aliasing
 CFLAGS_BASE_DRIVER += -Wno-format
-CFLAGS_BASE_DRIVER += -Wno-missing-field-initializers
 CFLAGS_BASE_DRIVER += -Wno-pointer-to-int-cast
 CFLAGS_BASE_DRIVER += -Wno-format-nonliteral
 CFLAGS_BASE_DRIVER += -Wno-unused-variable
@@ -41,7 +40,6 @@ CFLAGS_BASE_DRIVER += -Wno-unused-value
 CFLAGS_BASE_DRIVER += -Wno-unused-parameter
 CFLAGS_BASE_DRIVER += -Wno-strict-aliasing
 CFLAGS_BASE_DRIVER += -Wno-format
-CFLAGS_BASE_DRIVER += -Wno-missing-field-initializers
 CFLAGS_BASE_DRIVER += -Wno-pointer-to-int-cast
 CFLAGS_BASE_DRIVER += -Wno-format-nonliteral
 CFLAGS_BASE_DRIVER += -Wno-format-security
diff --git a/drivers/net/ionic/Makefile b/drivers/net/ionic/Makefile
index bfbe15e27b..f74ac2d34f 100644
--- a/drivers/net/ionic/Makefile
+++ b/drivers/net/ionic/Makefile
@@ -31,7 +31,4 @@ SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_ethdev.c
 SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_lif.c
 SRCS-$(CONFIG_RTE_LIBRTE_IONIC_PMD) += ionic_main.c
 
-CFLAGS_ionic_dev.o += -Wno-missing-field-initializers
-CFLAGS_ionic_lif.o += -Wno-missing-field-initializers
-
 include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/net/ionic/meson.build b/drivers/net/ionic/meson.build
index 06b7760180..1c6362d27c 100644
--- a/drivers/net/ionic/meson.build
+++ b/drivers/net/ionic/meson.build
@@ -10,13 +10,3 @@ sources = files(
 	'ionic_lif.c',
 	'ionic_main.c'
 )
-
-error_cflags = [
-  '-Wno-missing-field-initializers',
-]
-
-foreach flag: error_cflags
-        if cc.has_argument(flag)
-                c_args += flag
-        endif
-endforeach
diff --git a/mk/toolchain/clang/rte.vars.mk b/mk/toolchain/clang/rte.vars.mk
index 3c49dc568d..d441f6d8f3 100644
--- a/mk/toolchain/clang/rte.vars.mk
+++ b/mk/toolchain/clang/rte.vars.mk
@@ -48,7 +48,7 @@ endif
 # process cpu flags
 include $(RTE_SDK)/mk/toolchain/$(RTE_TOOLCHAIN)/rte.toolchain-compat.mk
 
-# workaround clang bug with warning "missing field initializer" for "= {0}"
+# disable warning for non-initialised fields
 WERROR_FLAGS += -Wno-missing-field-initializers
 
 # disable packed member unalign warnings
diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk
index 9fc704193b..f19305e495 100644
--- a/mk/toolchain/gcc/rte.vars.mk
+++ b/mk/toolchain/gcc/rte.vars.mk
@@ -74,10 +74,8 @@ WERROR_FLAGS += -Wno-lto-type-mismatch
 endif
 endif
 
-# workaround GCC bug with warning "missing initializer" for "= {0}"
-ifeq ($(shell test $(GCC_VERSION) -lt 47 && echo 1), 1)
+# disable warning for non-initialised fields
 WERROR_FLAGS += -Wno-missing-field-initializers
-endif
 # workaround GCC bug with warning "may be used uninitialized"
 ifeq ($(shell test $(GCC_VERSION) -lt 47 && echo 1), 1)
 WERROR_FLAGS += -Wno-uninitialized
-- 
2.24.1


             reply	other threads:[~2020-01-21 14:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-21 14:35 Thomas Monjalon [this message]
2020-01-21 15:55 ` Ferruh Yigit
2020-02-06  2:13   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200121143531.2677911-1-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=beilei.xing@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=cardigliano@ntop.org \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=harry.van.haaren@intel.com \
    --cc=liang.j.ma@intel.com \
    --cc=peter.mccarthy@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=xiao.w.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).