From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org, guruprasadx.rao@intel.com
Subject: [dpdk-dev] DPDK build issues with gcc-8
Date: Mon, 19 Mar 2018 10:50:47 -0700 [thread overview]
Message-ID: <20180319105047.37b30e50@xeon-e3> (raw)
Tried building DPDK with gcc-8 and got several new warnings.
Working on trivial patches for most of them, but the DPDK rte_table interface
for hashing has a more fundamental problem which Gcc-8 discovers.
The code is trying to cast an RTE hash function into a RTE table hash function
with a different signature. It works because the two are mostly the same, but
it really shouldn't be done that way:
Warning:
CC rte_table_hash_cuckoo.o
lib/librte_table/rte_table_hash_cuckoo.c: In function ‘rte_table_hash_cuckoo_create’:
lib/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),
^
RTE hash:
/** Type of function that can be used for calculating the hash value. */
typedef uint32_t (*rte_hash_function)(const void *key, uint32_t key_len,
uint32_t init_val);
RTE table hash:
/** Hash function */
typedef uint64_t (*rte_table_hash_op_hash)(
void *key,
void *key_mask,
uint32_t key_size,
uint64_t seed);
Just turning off the warning is not an acceptable solution. The API should really
be fixed. My preference would be to eliminate rte_table_hash_op_hash typedef
and keep rte_hash_function.
reply other threads:[~2018-03-19 17:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20180319105047.37b30e50@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=guruprasadx.rao@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).