From patchwork Tue Jan 21 09:58:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 65002 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3DA54A04DD; Tue, 21 Jan 2020 10:58:08 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9EFF1343C; Tue, 21 Jan 2020 10:58:07 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 64A38322C for ; Tue, 21 Jan 2020 10:58:06 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jan 2020 01:58:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,345,1574150400"; d="scan'208";a="221660852" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by fmsmga008.fm.intel.com with ESMTP; 21 Jan 2020 01:58:03 -0800 From: Ferruh Yigit To: Alfredo Cardigliano Cc: dev@dpdk.org, Anoob Joseph , Raslan Darawsheh , Xueming Zhang Date: Tue, 21 Jan 2020 09:58:01 +0000 Message-Id: <20200121095802.3942052-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200121094143.1904095-1-ferruh.yigit@intel.com> References: <20200121094143.1904095-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2] 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 a 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 intentional and it is safe to ignore this compiler warning. Adding '-Wno-missing-field-initializers' compiler flag to disable the warning. Reported-by: Anoob Joseph Reported-by: Raslan Darawsheh Reported-by: Xueming Zhang Signed-off-by: Ferruh Yigit --- v2: * add flag to ionic_lif.c too --- drivers/net/ionic/Makefile | 3 +++ drivers/net/ionic/meson.build | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/net/ionic/Makefile b/drivers/net/ionic/Makefile index f74ac2d34..bfbe15e27 100644 --- a/drivers/net/ionic/Makefile +++ b/drivers/net/ionic/Makefile @@ -31,4 +31,7 @@ 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 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