From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH] table: fix build error with gcc 8 Date: Mon, 9 Apr 2018 08:09:36 -0700 Message-ID: <20180409080936.58ecb66c@xeon-e3> References: <20180409124948.130974-1-jasvinder.singh@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, cristian.dumitrescu@intel.com To: Jasvinder Singh Return-path: Received: from mail-pg0-f67.google.com (mail-pg0-f67.google.com [74.125.83.67]) by dpdk.org (Postfix) with ESMTP id E24211B81B for ; Mon, 9 Apr 2018 17:09:40 +0200 (CEST) Received: by mail-pg0-f67.google.com with SMTP id t140so365422pgb.1 for ; Mon, 09 Apr 2018 08:09:40 -0700 (PDT) In-Reply-To: <20180409124948.130974-1-jasvinder.singh@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, 9 Apr 2018 13:49:48 +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 > --- > lib/librte_table/rte_table_hash_cuckoo.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_table/rte_table_hash_cuckoo.c b/lib/librte_table/rte_table_hash_cuckoo.c > index dcb4fe9..f7eae27 100644 > --- a/lib/librte_table/rte_table_hash_cuckoo.c > +++ b/lib/librte_table/rte_table_hash_cuckoo.c > @@ -103,11 +103,13 @@ rte_table_hash_cuckoo_create(void *params, > return NULL; > } > > + void *hash_func = p->f_hash; > + > /* Create cuckoo hash table */ > struct rte_hash_parameters hash_cuckoo_params = { > .entries = p->n_keys, > .key_len = p->key_size, > - .hash_func = (rte_hash_function)(p->f_hash), > + .hash_func = (rte_hash_function) hash_func, > .hash_func_init_val = p->seed, > .socket_id = socket_id, > .name = p->name This is just tricking the compiler into not complaining. I would really rather see the two hash functions made the same.