mk: ignore missing field initializers warning
authorThomas Monjalon <thomas@monjalon.net>
Tue, 21 Jan 2020 14:35:31 +0000 (15:35 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 6 Feb 2020 08:09:37 +0000 (09:09 +0100)
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>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
app/test/Makefile
drivers/event/opdl/Makefile
drivers/event/sw/Makefile
drivers/net/fm10k/Makefile
drivers/net/i40e/Makefile
drivers/net/ionic/Makefile
drivers/net/ionic/meson.build
mk/toolchain/clang/rte.vars.mk
mk/toolchain/gcc/rte.vars.mk

index d955dbb..b9bb3a7 100644 (file)
@@ -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
 
index fb87c7d..1dfd6f5 100644 (file)
@@ -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
index 17937e2..8ea5cce 100644 (file)
@@ -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
index 722bf1e..0271bcb 100644 (file)
@@ -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
index 435eb51..819473a 100644 (file)
@@ -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
index bfbe15e..f74ac2d 100644 (file)
@@ -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
index 06b7760..1c6362d 100644 (file)
@@ -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
index 3c49dc5..d441f6d 100644 (file)
@@ -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
index 9fc7041..f19305e 100644 (file)
@@ -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