From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 115F4A0525; Tue, 21 Jan 2020 15:35:45 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 22A123772; Tue, 21 Jan 2020 15:35:44 +0100 (CET) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by dpdk.org (Postfix) with ESMTP id 0EF283253 for ; Tue, 21 Jan 2020 15:35:43 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 63416578; Tue, 21 Jan 2020 09:35:41 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 21 Jan 2020 09:35:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=mesmtp; bh=qHoYiRIQ9TRehbQhPdLXfoE RF9+C8T6OMGPP7uWHz0U=; b=KF9QjiDtj8VpbxTvprSX9sjsK0mSoi37r2jd+M2 vlD5nd9vtnTCpJa39mXcBPqBs6rWcyKii+wdeTjtZ2pSuI4SRxU14u0PnbiU18PI M5hOibUWaQusauaxjciMoq+eJDEWM52EMqgfo2+41gjiSArFQ9bzfVy9mCimuAAs UlgE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=qHoYiRIQ9TRehbQhP dLXfoERF9+C8T6OMGPP7uWHz0U=; b=AEimNbQLFIUvSyzfg/d/zg0JsB1TQBRxy rbN/MlbURhIibxahHlzb/NENQLH98hSckJX5Fu7ax0XgIuxAOuzyOwv5mBtBg5q3 wXYR/K/0y7SauAJS31Oa8f6YIgeyLXxYcogKlGW5rJBT15brxKpyL7vDJbAP8EXz dbz9+LcKnepotofcZ1WHM2HyCwpN7g7R6Nf5QOdwyI/4YGt8SwVtuX+ugXMAe010 0Tz1RP92wwaUdcPr9cJTk3TeW2NZode+og6Pl1KCimPLccb7UuTk9UkatzMzZpUN uMaxY7SnA8KBYzehiAF8HScehA3+o7JU7/hfEMHuk/3kiGqE1lsTw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudekgdeihecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghsucfo ohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucffohhmrg hinhepvhgrrhhsrdhmkhdplhhisgdrmhhkpdhtohholhgthhgrihhnqdgtohhmphgrthdr mhhknecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhn vght X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 4E6F63280061; Tue, 21 Jan 2020 09:35:39 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ferruh.yigit@intel.com, bruce.richardson@intel.com, Liang Ma , Peter Mccarthy , Harry van Haaren , Qi Zhang , Xiao Wang , Beilei Xing , Alfredo Cardigliano Date: Tue, 21 Jan 2020 15:35:31 +0100 Message-Id: <20200121143531.2677911-1-thomas@monjalon.net> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] mk: ignore missing field initializers warning X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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