From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 2DB391B7E6 for ; Mon, 9 Apr 2018 17:28:17 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Apr 2018 08:28:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,427,1517904000"; d="scan'208";a="44716220" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.51]) by fmsmga004.fm.intel.com with SMTP; 09 Apr 2018 08:28:14 -0700 Received: by (sSMTP sendmail emulation); Mon, 09 Apr 2018 16:28:13 +0100 Date: Mon, 9 Apr 2018 16:28:12 +0100 From: Bruce Richardson To: "Singh, Jasvinder" Cc: "dev@dpdk.org" , "Dumitrescu, Cristian" Message-ID: <20180409152812.GA114584@bricha3-MOBL.ger.corp.intel.com> References: <20180409124948.130974-1-jasvinder.singh@intel.com> <20180409130902.GA129412@bricha3-MOBL.ger.corp.intel.com> <54CBAA185211B4429112C315DA58FF6D33334FB8@IRSMSX101.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54CBAA185211B4429112C315DA58FF6D33334FB8@IRSMSX101.ger.corp.intel.com> Organization: Intel Research and Development Ireland Ltd. User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH] table: fix build error with gcc 8 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: Mon, 09 Apr 2018 15:28:18 -0000 On Mon, Apr 09, 2018 at 03:51:10PM +0100, Singh, Jasvinder wrote: > > > -----Original Message----- > > From: Richardson, Bruce > > Sent: Monday, April 9, 2018 2:09 PM > > To: Singh, Jasvinder > > Cc: dev@dpdk.org; Dumitrescu, Cristian > > Subject: Re: [dpdk-dev] [PATCH] table: fix build error with gcc 8 > > > > On Mon, Apr 09, 2018 at 01:49:48PM +0100, Jasvinder Singh wrote: > > > Fix build error with gcc 8.0 due to cast between function types. > > > Fixes: 5a80bf0ae613 ("table: add cuckoo hash") > > > > > > Signed-off-by: Jasvinder Singh > > > > What's the actual error message? Why do the types not match? > > > > /Bruce > > Error log is captured below; > > CC rte_table_hash_cuckoo.o > /librte_table/rte_table_hash_cuckoo.c: In function 'rte_table_hash_cuckoo_create': > /librte_table/rte_table_hash_cuckoo.c:110:16: error: cast between incompatible > function types from 'rte_table_hash_op_hash' {aka 'long unsigned int (*)(void *, void *, unsigned int, long unsigned int)'} > to 'uint32_t (*)(const void *, uint32_t, uint32_t)' {aka 'unsigned int (*)(const void *, unsigned int, unsigned int)'} [-Werror=cast-function-type] > .hash_func = (rte_hash_function) p->f_hash, > ^ > cc1: all warnings being treated as errors > Even if the compiler isn't complaining now, how can that cast work? Looking at the error message given, it appears there are two big issues: 1. The expected function call takes 3 parameters: (const void *, uint32_t, uint32_t), but you are giving it a function that takes 4 parameters: (void *, void *, unsigned int, long unsigned int) 2. The return type expected is "unsigned int", but you are giving a function returning "long unsigned int". On 32-bit systems, these are going to be the same size, but on 64-bit, they will be different. Similarly for the last function argument. Is the error message correct? /Bruce