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 CAF75A04DD; Tue, 21 Jan 2020 10:41:49 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8BAF6322C; Tue, 21 Jan 2020 10:41:48 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id CA0AE2BF5 for ; Tue, 21 Jan 2020 10:41:46 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jan 2020 01:41:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,345,1574150400"; d="scan'208";a="215479871" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by orsmga007.jf.intel.com with ESMTP; 21 Jan 2020 01:41:45 -0800 From: Ferruh Yigit To: Raslan Darawsheh Cc: dev@dpdk.org Date: Tue, 21 Jan 2020 09:41:43 +0000 Message-Id: <20200121094143.1904095-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] net/ionic: 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" The compiler warning is: from .../drivers/net/ionic/ionic_dev.c:7: .../drivers/net/ionic/ionic_if.h:202:5: note: ‘rsvd’ declared here u8 rsvd[62]; ^ This has been observed with gcc 4.8.5, newer 9+ compiler are not giving this warning. Warning is to reminder to the user that there are some fields in the struct not initialized with the default value. But the C standard clarifies that in that case the field value will be zero and code is aware of this behavior, so no initializing to a default value is an intentional and it is safe to ignore this compiler warning. Adding '-Wno-missing-field-initializers' compiler flag to disable the warning. Signed-off-by: Ferruh Yigit --- drivers/net/ionic/Makefile | 2 ++ drivers/net/ionic/meson.build | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/drivers/net/ionic/Makefile b/drivers/net/ionic/Makefile index f74ac2d34..f218704cf 100644 --- a/drivers/net/ionic/Makefile +++ b/drivers/net/ionic/Makefile @@ -31,4 +31,6 @@ 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 + include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/net/ionic/meson.build b/drivers/net/ionic/meson.build index dee8a3608..06b776018 100644 --- a/drivers/net/ionic/meson.build +++ b/drivers/net/ionic/meson.build @@ -11,3 +11,12 @@ sources = files( 'ionic_main.c' ) +error_cflags = [ + '-Wno-missing-field-initializers', +] + +foreach flag: error_cflags + if cc.has_argument(flag) + c_args += flag + endif +endforeach -- 2.24.1