From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 3ABDD1B19E for ; Fri, 6 Oct 2017 01:24:50 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Oct 2017 16:24:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,482,1500966000"; d="scan'208";a="907211118" Received: from unknown (HELO [10.241.225.33]) ([10.241.225.33]) by FMSMGA003.fm.intel.com with ESMTP; 05 Oct 2017 16:24:48 -0700 To: Olivier Matz , dev@dpdk.org, Jingjing Wu , Beilei Xing References: <20170911151333.5727-1-olivier.matz@6wind.com> <20170911151333.5727-5-olivier.matz@6wind.com> From: Ferruh Yigit Message-ID: Date: Fri, 6 Oct 2017 00:24:48 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170911151333.5727-5-olivier.matz@6wind.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 04/10] net/i40e: fix compilation with -Og 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: , X-List-Received-Date: Thu, 05 Oct 2017 23:24:50 -0000 On 9/11/2017 4:13 PM, Olivier Matz wrote: > The compilation with gcc-6.3.0 and EXTRA_CFLAGS=-Og gives the following > error: > > CC i40e_adminq.o > i40e_adminq.c: In function ‘i40e_clean_arq_element’: > i40e_adminq.c:1145:56: error: ‘ntu’ may be used uninitialized in > this function [-Werror=maybe-uninitialized] > *pending = (ntc > ntu ? hw->aq.arq.count : 0) + (ntu - ntc); > ~~~~~^~~~~~ > > Depending on what is defined, ntu actually be used without being > initialized. Fix it by initializing it to 0, despite this is probably > not the proper fix. Moreover, the error is located in base/ directory, > which contains driver code common to several platforms (not only dpdk). This practically seems false positive because driver makefile hard-coded both defines. Also ntu used before this location, not sure warning generated for here. Overall I am for fixing the compile warning, but for decision maintainer cc'ed because this being base code update requires maintainer communicate other channels to reflect update into base code. > > Signed-off-by: Olivier Matz > --- > drivers/net/i40e/base/i40e_adminq.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/i40e/base/i40e_adminq.c b/drivers/net/i40e/base/i40e_adminq.c > index 8cc8c5eca..27c133323 100644 > --- a/drivers/net/i40e/base/i40e_adminq.c > +++ b/drivers/net/i40e/base/i40e_adminq.c > @@ -1047,7 +1047,7 @@ enum i40e_status_code i40e_clean_arq_element(struct i40e_hw *hw, > u16 desc_idx; > u16 datalen; > u16 flags; > - u16 ntu; > + u16 ntu = 0; > > /* pre-clean the event info */ > i40e_memset(&e->desc, 0, sizeof(e->desc), I40E_NONDMA_MEM); >