From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 1ED016CD1 for ; Fri, 8 Jul 2016 16:07:15 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 08 Jul 2016 07:07:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,330,1464678000"; d="scan'208";a="1003214493" Received: from lcteoh-mobl2.gar.corp.intel.com (HELO [10.255.150.176]) ([10.255.150.176]) by fmsmga001.fm.intel.com with ESMTP; 08 Jul 2016 07:07:05 -0700 To: Bruce Richardson References: <1466510763-19569-6-git-send-email-jan@semihalf.com> <1467299099-32498-1-git-send-email-jan@semihalf.com> <1467299099-32498-7-git-send-email-jan@semihalf.com> <577B7539.3000007@intel.com> <20160708132342.GA20808@bricha3-MOBL3> Cc: Jan Medala , dev@dpdk.org, Alexander Matushevsky , Jakub Palider From: Ferruh Yigit Message-ID: <577FB386.7090907@intel.com> Date: Fri, 8 Jul 2016 15:07:02 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <20160708132342.GA20808@bricha3-MOBL3> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v3 6/6] ena: fix for icc compiler X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2016 14:07:16 -0000 On 7/8/2016 2:23 PM, Bruce Richardson wrote: > On Tue, Jul 05, 2016 at 09:52:09AM +0100, Ferruh Yigit wrote: >> On 6/30/2016 4:04 PM, Jan Medala wrote: >>> Signed-off-by: Alexander Matushevsky >>> Signed-off-by: Jakub Palider >>> Signed-off-by: Jan Medala >> >> The compilation error to fix is [1], it may be good to add what to fix >> into commit log. >> >> [1] >> == Build drivers/net/ena >> CC ena_ethdev.o >> /tmp/dpdk_maintain/ena_v3/dpdk/drivers/net/ena/ena_ethdev.c(943): error >> #188: enumerated type mixed with another type >> struct ena_com_create_io_ctx ctx = { 0 }; >> ^ >> >> /tmp/dpdk_maintain/ena_v3/dpdk/drivers/net/ena/ena_ethdev.c(1036): error >> #188: enumerated type mixed with another type >> struct ena_com_create_io_ctx ctx = { 0 }; >> ^ >> ... >> >>> --- a/drivers/net/ena/ena_ethdev.c >>> +++ b/drivers/net/ena/ena_ethdev.c >>> @@ -940,7 +940,10 @@ static int ena_tx_queue_setup(struct rte_eth_dev *dev, >>> __rte_unused unsigned int socket_id, >>> __rte_unused const struct rte_eth_txconf *tx_conf) >>> { >>> - struct ena_com_create_io_ctx ctx = { 0 }; >>> + struct ena_com_create_io_ctx ctx = >>> + /* policy set to _HOST just to satisfy icc compiler */ >>> + { ENA_ADMIN_PLACEMENT_POLICY_HOST, >>> + ENA_COM_IO_QUEUE_DIRECTION_TX, 0, 0, 0, 0 }; >> >> Trailing "0" are not required, compiler will take care of them. >> > Actually, given that this is a structure init and not an array, the trailing > zeros are actually required, since we are not using C99 designated initializers. As far as I know same thing is valid for both array and struct. uninitialized values set to default values. c.c: ---- struct mys { int a; int b; int c; }; int main(int argc, char *argv[]) { struct mys s = {99}; return 0; } gcc -S -std=c90 c.c c.s: ---- ... movl %edi, -20(%rbp) movq %rsi, -32(%rbp) movq $0, -16(%rbp) <---- movl $0, -8(%rbp) <---- movl $99, -16(%rbp) movl $0, %eax popq %rbp ret ... > Therefore, I'll leave the zeros in - if anyone wants to convert the format of > the initializers to c99 style later, and remove the trailing zeros then, it can > go as a separate patch. I'll just merge this fix in with patch 1 that introduces > the issue. > > /Bruce >