From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f67.google.com (mail-pl0-f67.google.com [209.85.160.67]) by dpdk.org (Postfix) with ESMTP id 330BF1B846 for ; Mon, 9 Apr 2018 18:41:35 +0200 (CEST) Received: by mail-pl0-f67.google.com with SMTP id v5-v6so5493005plo.4 for ; Mon, 09 Apr 2018 09:41:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oPzPVuzijG4OHaOcdvHCa6VycjYkBcj36t0zety6jo0=; b=dvdjNttk7NyjQJJ9GV/6nowe+6uHvAfkf+JIKmkIwpc1ZmEuv1EFjVV/S0yZTmD7QP bCbwI/Sy3xUj5SMk5LZ5TPZosJjvyXspjBbP3lpgA6wYaNHI4X+DV0HOkHd16sz7XcYK ISDVtR0/Wm+dtrjryUZlhaZgsijq5MSrjtavajpIiURnMqss2dJAQRvkFNqrzxbs9QzY lNdDnBTT1hAofH65zMcTDXT/xnmCv7BURVlWQRe4De4ZpQ5RkWJwVF5TReND50QKM+Da CMU6Nv4/uV/rqxW5ODaJRxG7OOTUm+LnI6rIh8Kjrf01TkmM7XakWe1bf7ns1vkVCsB8 HO5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oPzPVuzijG4OHaOcdvHCa6VycjYkBcj36t0zety6jo0=; b=XLvp5kjkniYH6QulnmhI3IJIjGvPQktkqGioizXo9xrKOMeNGVS006rP/PD0nVNOx9 YDuKa4nJvPq/ooyj0uVoUjZylPCkr6dmZXP6VthS8lblTkltMj9ec66DlkJV4JxBRvCD cweYzW3rbO8wKfblR+FPiC9GTH9fjgWKwh6K3c0LoWNowC+mM2TTw9UxOBZccxCUhm6b dIXAeLAIcu3JuD8TLjcCcLCOg1AhSpxz5VBMeocImy5Vh0RRF0rgWr58AR5jcRBIQBLW ldab1gDxGNurup4TyAGjWb8V1dr16AELhnXxxRsatWonqQV08Tt9UJWYzXi3FVOgIs6x gMRQ== X-Gm-Message-State: AElRT7Gv8TgP3qFWdFqAVc0cq9HiC4V+ZbV4JeomUkF7Eu+ovCgxWhwo BsZLoxBHPiuwWpsUoeWOpulz2Q== X-Google-Smtp-Source: AIpwx4/ncRagG4kCIFEyKsBQ+Vr1sIcZnjLaHfTx7nXa560nm5CRh3Cef1sZaS7f9+4mdEMfnDS29g== X-Received: by 2002:a17:902:1e2:: with SMTP id b89-v6mr38852535plb.389.1523292094339; Mon, 09 Apr 2018 09:41:34 -0700 (PDT) Received: from xeon-e3 (204-195-71-95.wavecable.com. [204.195.71.95]) by smtp.gmail.com with ESMTPSA id b187sm1387481pfg.164.2018.04.09.09.41.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Apr 2018 09:41:34 -0700 (PDT) Date: Mon, 9 Apr 2018 09:41:32 -0700 From: Stephen Hemminger To: Bruce Richardson Cc: "Singh, Jasvinder" , "dev@dpdk.org" , "Dumitrescu, Cristian" Message-ID: <20180409094132.3e439df7@xeon-e3> In-Reply-To: <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> <20180409152812.GA114584@bricha3-MOBL.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 16:41:35 -0000 On Mon, 9 Apr 2018 16:28:12 +0100 Bruce Richardson wrote: > 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? Yes. the current code is working only by luck