DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: "Singh, Jasvinder" <jasvinder.singh@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>
Subject: Re: [dpdk-dev] [PATCH] table: fix build error with gcc 8
Date: Mon, 9 Apr 2018 16:28:12 +0100	[thread overview]
Message-ID: <20180409152812.GA114584@bricha3-MOBL.ger.corp.intel.com> (raw)
In-Reply-To: <54CBAA185211B4429112C315DA58FF6D33334FB8@IRSMSX101.ger.corp.intel.com>

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 <jasvinder.singh@intel.com>
> > Cc: dev@dpdk.org; Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> > 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 <jasvinder.singh@intel.com>
> > 
> > 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

  reply	other threads:[~2018-04-09 15:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-09 12:49 Jasvinder Singh
2018-04-09 12:59 ` Dumitrescu, Cristian
2018-04-09 13:09 ` Bruce Richardson
2018-04-09 14:51   ` Singh, Jasvinder
2018-04-09 15:28     ` Bruce Richardson [this message]
2018-04-09 16:41       ` Stephen Hemminger
2018-04-09 15:09 ` Stephen Hemminger
2018-04-09 15:58   ` Dumitrescu, Cristian
2018-04-09 16:38     ` Van Haaren, Harry
2018-04-09 16:43       ` Ferruh Yigit
2018-04-09 17:05         ` Dumitrescu, Cristian
2018-04-09 17:02       ` Dumitrescu, Cristian
2018-04-09 17:09         ` Ananyev, Konstantin
2018-04-09 17:26           ` Dumitrescu, Cristian
2018-04-10 12:32             ` Van Haaren, Harry
2018-04-10 11:43       ` Neil Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180409152812.GA114584@bricha3-MOBL.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=jasvinder.singh@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).