From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
To: Andy Green <andy@warmcat.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v3 00/40] Fix build on gcc8 and various bugs
Date: Thu, 10 May 2018 14:49:37 +0530 [thread overview]
Message-ID: <20180510091936.GB26838@jerin> (raw)
In-Reply-To: <2aa359ce-9441-7c9c-4492-8546bd6568ea@warmcat.com>
-----Original Message-----
> Date: Thu, 10 May 2018 15:11:11 +0800
> From: Andy Green <andy@warmcat.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> CC: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v3 00/40] Fix build on gcc8 and various bugs
> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
> Thunderbird/52.7.0
>
>
>
> On 05/10/2018 02:12 PM, Jerin Jacob wrote:
> > -----Original Message-----
> > > Date: Thu, 10 May 2018 10:46:18 +0800
> > > From: Andy Green <andy@warmcat.com>
> > > To: dev@dpdk.org
> > > Subject: [dpdk-dev] [PATCH v3 00/40] Fix build on gcc8 and various bugs
> > > User-Agent: StGit/unknown-version
> > >
> > > The following series gets current master able to build
> > > itself, and allow lagopus to build against it, on Fedora 28 +
> > > x86_64 using gcc 8.0.1.
> > >
> > > The first 17 patches have already been through two spins and
> > > this time are corrected for all the comment (thanks to
> > > everybody who commented) since v2, and have tested-by /
> > > acked-bys applied. The first workaround patch for the hash
> > > function cast problem is dropped since something has already
> > > been applied in master since yesterday to address it.
> > >
> > > The additional 23 patches are fixes for problems found
> > > actually trying to build lagopus using current master.
> > > These are almost entirely related to signed / unsigned
> > > or truncation without explicit casts inside dpdk
> > > headers.
> >
> >
> > Tested this series on gcc version 8.1.0
> >
> > Found following error:
>
> On gcc 8.0.1 on Fedora 28, where this doesn't appear using x86_64 defconfig.
> This is with the basis the current master HEAD
> 8ea41438832a360aed2b7ba49fb75e310a2ff1dc
I use the same change set. I think, In GCC 8.1, they have added
strict function type casting check.
I see a lot failure in examples with GCC 8.1, Are you tested the examples directory?
>
> I assume 8.1 just got better at spotting the problem.
>
> > /export/dpdk.org/test/test/test_table_pipeline.c: In function
> > ‘test_table_pipeline’:
> > /export/dpdk.org/test/test/test_table_pipeline.c:521:3: error: cast
> > between incompatible function types from ‘int (* (*)(struct rte_pipeline
> > *, struct rte_mbuf **, uint64_t, struct rte_pipeline_table_entry **,
> > void *))(struct rte_pipeline *, struct rte_mbuf **, uint64_t, struct
> > rte_pipeline_table_entry *, void *)’ {aka ‘int (* (*)(struct
> > rte_pipeline *, struct rte_mbuf **, long unsigned int, struct
> > rte_pipeline_table_entry **, void *))(struct rte_pipeline *, struct
> > rte_mbuf **, long unsigned int, struct rte_pipeline_table_entry *, void
> > *)’} to ‘int (*)(struct rte_pipeline *, struct rte_mbuf **, uint64_t,
> > struct rte_pipeline_table_entry *, void *)’ {aka ‘int (*)(struct
> > rte_pipeline *, struct rte_mbuf **, long unsigned int, struct
> > rte_pipeline_table_entry *, void *)’} [-Werror=cast-function-type]
> > (rte_pipeline_table_action_handler_miss) table_action_stub_miss;
> > ^
> > /export/dpdk.org/test/test/test_table_pipeline.c:557:3: error: cast
> > between incompatible function types from ‘int (* (*)(struct rte_pipeline
> > *, struct rte_mbuf **, uint64_t, struct rte_pipeline_table_entry **,
> > void *))(struct rte_pipeline *, struct rte_mbuf **, uint64_t, struct
> > rte_pipeline_table_entry *, void *)’ {aka ‘int (* (*)(struct
> > rte_pipeline *, struct rte_mbuf **, long unsigned int, struct
> > rte_pipeline_table_entry **, void *))(struct rte_pipeline *, struct
> > rte_mbuf **, long unsigned int, struct rte_pipeline_table_entry *, void
> > *)’} to ‘int (*)(struct rte_pipeline *, struct rte_mbuf **, uint64_t,
> > struct rte_pipeline_table_entry *, void *)’ {aka ‘int (*)(struct
> > rte_pipeline *, struct rte_mbuf **, long unsigned int, struct
> > rte_pipeline_table_entry *, void *)’} [-Werror=cast-function-type]
> > (rte_pipeline_table_action_handler_miss)table_action_stub_miss;
>
> Hum...
>
> That seems to be declared:
>
> rte_pipeline_table_action_handler_miss action_handler_miss = NULL;
>
> which is
>
> typedef int (*rte_pipeline_table_action_handler_miss)(
> struct rte_pipeline *p,
> struct rte_mbuf **pkts,
> uint64_t pkts_mask,
> struct rte_pipeline_table_entry *entry, <<<<=====
> void *arg);
>
> We're doing
>
> action_handler_miss =
> (rte_pipeline_table_action_handler_miss)table_action_stub_miss;
>
> The prototype for that is
>
> rte_pipeline_table_action_handler_miss
> table_action_stub_miss(struct rte_pipeline *p,
> struct rte_mbuf **pkts,
> uint64_t pkts_mask,
> struct rte_pipeline_table_entry **entry, <<====
> void *arg);
>
> It's true, the fourth arg has a different level of indirection... it seems
> another real pre-existing problem.
>
> However the stub doesn't use the fourth arg "entry"
>
> rte_pipeline_table_action_handler_miss
> table_action_stub_miss(struct rte_pipeline *p,
> __attribute__((unused)) struct rte_mbuf **pkts,
> uint64_t pkts_mask,
> __attribute__((unused)) struct rte_pipeline_table_entry **entry,
> __attribute__((unused)) void *arg)
> {
> printf("STUB Table Action Miss - setting mask to 0x%"PRIx64"\n",
> override_miss_mask);
> pkts_mask = (~override_miss_mask) & 0x3;
> rte_pipeline_ah_packet_drop(p, pkts_mask);
> return 0;
> }
>
> Therefore, since I can't get the error here, can you check if this solves
> it?
>
> diff --git a/test/test/test_table_pipeline.c
> b/test/test/test_table_pipeline.c
> index 055a1a4e7..d007d55ce 100644
> --- a/test/test/test_table_pipeline.c
> +++ b/test/test/test_table_pipeline.c
> @@ -71,7 +71,7 @@ table_action_stub_hit(struct rte_pipeline *p, struct
> rte_mbuf **pkts,
>
> rte_pipeline_table_action_handler_miss
> table_action_stub_miss(struct rte_pipeline *p, struct rte_mbuf **pkts,
> - uint64_t pkts_mask, struct rte_pipeline_table_entry **entry, void
> *arg);
> + uint64_t pkts_mask, struct rte_pipeline_table_entry *entry, void
> *arg);
>
> rte_pipeline_table_action_handler_hit
> table_action_0x00(__attribute__((unused)) struct rte_pipeline *p,
> @@ -105,7 +105,7 @@ rte_pipeline_table_action_handler_miss
> table_action_stub_miss(struct rte_pipeline *p,
> __attribute__((unused)) struct rte_mbuf **pkts,
> uint64_t pkts_mask,
> - __attribute__((unused)) struct rte_pipeline_table_entry **entry,
> + __attribute__((unused)) struct rte_pipeline_table_entry *entry,
> __attribute__((unused)) void *arg)
> {
> printf("STUB Table Action Miss - setting mask to 0x%"PRIx64"\n",
>
>
> At least I confirmed it still builds without error on 8.0.1 with my series
> and that patch.
OK.
The above patch does not help, GCC 8.1 simply don't like any from
function typecasting. see ^^^^^ in the quote below.
/export/dpdk.org/test/test/test_table_pipeline.c: In function
‘test_table_pipeline’:
/export/dpdk.org/test/test/test_table_pipeline.c:521:3: error: cast
between incompatible function types from ‘int (* (*)(struct rte_pipeline
*, struct rte_mbuf **, uint64_t, struct rte_pipeline_table_entry *,
void *))(struct rte_pipeline *, struct rte_mbuf **, uint64_t, struct
rte_pipeline_table_entry *, void *)’ {aka ‘int (* (*)(struct
^^^^^^^^
rte_pipeline *, struct rte_mbuf **, long unsigned int, struct
rte_pipeline_table_entry *, void *))(struct rte_pipeline *, struct
rte_mbuf **, long unsigned int, struct rte_pipeline_table_entry *, void
*)’} to ‘int (*)(struct rte_pipeline *, struct rte_mbuf **, uint64_t,
^^^^^^^^^
struct rte_pipeline_table_entry *, void *)’ {aka ‘int (*)(struct
rte_pipeline *, struct rte_mbuf **, long unsigned int, struct
rte_pipeline_table_entry *, void *)’} [-Werror=cast-function-type]
(rte_pipeline_table_action_handler_miss) table_action_stub_miss;
^
/export/dpdk.org/test/test/test_table_pipeline.c:557:3: error: cast
between incompatible function types from ‘int (* (*)(struct rte_pipeline
*, struct rte_mbuf **, uint64_t, struct rte_pipeline_table_entry *,
void *))(struct rte_pipeline *, struct rte_mbuf **, uint64_t, struct
rte_pipeline_table_entry *, void *)’ {aka ‘int (* (*)(struct
rte_pipeline *, struct rte_mbuf **, long unsigned int, struct
rte_pipeline_table_entry *, void *))(struct rte_pipeline *, struct
rte_mbuf **, long unsigned int, struct rte_pipeline_table_entry *, void
*)’} to ‘int (*)(struct rte_pipeline *, struct rte_mbuf **, uint64_t,
struct rte_pipeline_table_entry *, void *)’ {aka ‘int (*)(struct
rte_pipeline *, struct rte_mbuf **, long unsigned int, struct
rte_pipeline_table_entry *, void *)’} [-Werror=cast-function-type]
(rte_pipeline_table_action_handler_miss)table_action_stub_miss;
^
cc1: all warnings being treated as errors
next prev parent reply other threads:[~2018-05-10 9:19 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-10 2:46 Andy Green
2018-05-10 2:46 ` [dpdk-dev] [PATCH v3 01/40] drivers/bus/pci: fix strncpy dangerous code Andy Green
2018-05-10 12:55 ` De Lara Guarch, Pablo
2018-05-10 2:46 ` [dpdk-dev] [PATCH v3 02/40] drivers/bus/dpaa: fix inconsistent struct alignment Andy Green
2018-05-10 2:46 ` [dpdk-dev] [PATCH v3 03/40] drivers/net/axgbe: fix broken eeprom string comp Andy Green
2018-05-10 2:46 ` [dpdk-dev] [PATCH v3 04/40] drivers/net/nfp/nfpcore: fix strncpy misuse Andy Green
2018-05-10 2:46 ` [dpdk-dev] [PATCH v3 05/40] drivers/net/nfp/nfpcore: fix off-by-one and no NUL on strncpy use Andy Green
2018-05-10 2:46 ` [dpdk-dev] [PATCH v3 06/40] drivers/net/nfp: don't memcpy out of source range Andy Green
2018-05-10 2:46 ` [dpdk-dev] [PATCH v3 07/40] drivers/net/nfp: fix buffer overflow in fw_name Andy Green
2018-05-10 2:46 ` [dpdk-dev] [PATCH v3 08/40] drivers/net/qede: fix strncpy constant and NUL Andy Green
2018-05-10 2:47 ` [dpdk-dev] [PATCH v3 09/40] drivers/net/qede: fix broken strncpy Andy Green
2018-05-10 2:47 ` [dpdk-dev] [PATCH v3 10/40] drivers/net/sfc: fix strncpy length Andy Green
2018-05-10 2:47 ` [dpdk-dev] [PATCH v3 11/40] drivers/net/sfc: fix strncpy size and NUL Andy Green
2018-05-10 2:47 ` [dpdk-dev] [PATCH v3 12/40] drivers/net/vdev: readlink inputs cannot be aliased Andy Green
2018-05-10 2:47 ` [dpdk-dev] [PATCH v3 13/40] drivers/net/vdev: fix 3 x strncpy misuse Andy Green
2018-05-10 2:47 ` [dpdk-dev] [PATCH v3 14/40] app/test-pmd: can't find include Andy Green
2018-05-10 13:50 ` De Lara Guarch, Pablo
2018-05-10 2:47 ` [dpdk-dev] [PATCH v3 15/40] app/proc-info: fix sprintf overrun bug Andy Green
2018-05-10 2:47 ` [dpdk-dev] [PATCH v3 16/40] app/test-bbdev: test-bbdev: strcpy ok for allocated string Andy Green
2018-05-10 2:47 ` [dpdk-dev] [PATCH v3 17/40] app/test-bbdev: " Andy Green
2018-05-10 2:47 ` [dpdk-dev] [PATCH v3 18/40] rte_common.h: cast gcc builtin result to avoid complaints Andy Green
2018-05-10 2:47 ` [dpdk-dev] [PATCH v3 19/40] rte_memcpy.h: explicit tmp cast Andy Green
2018-05-10 2:47 ` [dpdk-dev] [PATCH v3 20/40] lib/librte_eal/common/include/rte_lcore.h: explicit cast for signed change Andy Green
2018-05-10 2:48 ` [dpdk-dev] [PATCH v3 21/40] /lib/librte_eal/common/include/rte_random.h: stage cast from uint64_t to long Andy Green
2018-05-10 2:48 ` [dpdk-dev] [PATCH v3 22/40] rte_spinlock.h: stack declarations before code Andy Green
2018-05-10 2:48 ` [dpdk-dev] [PATCH v3 23/40] rte_ring_generic.h: " Andy Green
2018-05-10 2:48 ` [dpdk-dev] [PATCH v3 24/40] rte_ring.h: remove signed type flipflopping Andy Green
2018-05-10 2:48 ` [dpdk-dev] [PATCH v3 25/40] rte_dev.h: stack declaration at top of own basic block Andy Green
2018-05-10 2:48 ` [dpdk-dev] [PATCH v3 26/40] rte_mbuf.h: avoid truncation warnings from inadvertant int16_t to int promotion Andy Green
2018-05-10 2:48 ` [dpdk-dev] [PATCH v3 27/40] rte_mbuf.h: explicit casts for flipping between int16_t and uint16_t Andy Green
2018-05-10 2:48 ` [dpdk-dev] [PATCH v3 28/40] rte_mbuf.h: make sure RTE_MIN compares same types Andy Green
2018-05-10 2:48 ` [dpdk-dev] [PATCH v3 29/40] rte_mbuf.h: explicit cast restricting ptrdiff to uint16_t Andy Green
2018-05-10 2:48 ` [dpdk-dev] [PATCH v3 30/40] rte_mbuf.h: explicit cast for size_t to uint32_t Andy Green
2018-05-10 2:48 ` [dpdk-dev] [PATCH v3 31/40] rte_mbuf.h: explicit casts to uint16_t to avoid truncation warnings Andy Green
2018-05-10 2:49 ` [dpdk-dev] [PATCH v3 32/40] rte_byteorder.h: explicit cast for return promotion Andy Green
2018-05-10 2:49 ` [dpdk-dev] [PATCH v3 33/40] rte_ether.h: explicit cast avoiding truncation warning Andy Green
2018-05-10 2:49 ` [dpdk-dev] [PATCH v3 34/40] rte_ether.h: stack vars declared at top of function Andy Green
2018-05-10 2:49 ` [dpdk-dev] [PATCH v3 35/40] rte_ethdev.h: fix sign and scope of temp var Andy Green
2018-05-10 2:49 ` [dpdk-dev] [PATCH v3 36/40] rte_ethdev.h: explicit cast for return type Andy Green
2018-05-10 19:18 ` Stephen Hemminger
2018-05-10 23:48 ` Andy Green
2018-05-10 2:49 ` [dpdk-dev] [PATCH v3 37/40] rte_ethdev.h: explicit cast for truncation Andy Green
2018-05-10 2:49 ` [dpdk-dev] [PATCH v3 38/40] rte_hash_crc.h: stack vars declared at top of function Andy Green
2018-05-10 2:49 ` [dpdk-dev] [PATCH v3 39/40] rte_hash_crc.h: explicit casts for truncation Andy Green
2018-05-10 2:49 ` [dpdk-dev] [PATCH v3 40/40] rte_string_fns.h: explicit cast for int return to size_t Andy Green
2018-05-10 19:17 ` Stephen Hemminger
2018-05-11 0:13 ` Andy Green
2018-05-10 6:12 ` [dpdk-dev] [PATCH v3 00/40] Fix build on gcc8 and various bugs Jerin Jacob
2018-05-10 7:11 ` Andy Green
2018-05-10 9:19 ` Jerin Jacob [this message]
2018-05-10 6:17 ` Jerin Jacob
2018-05-10 6:46 ` Andy Green
2018-05-10 9:11 ` Jerin Jacob
2018-05-10 11:44 ` Andy Green
2018-05-10 11:58 ` Jerin Jacob
2018-05-10 12:13 ` Andy Green
2018-05-10 15:01 ` Stephen Hemminger
2018-05-11 0:29 ` Andy Green
2018-05-11 1:37 ` Andy Green
2018-05-13 13:58 ` Thomas Monjalon
2018-05-10 9:52 ` De Lara Guarch, Pablo
2018-05-10 11:57 ` Andy Green
2018-05-10 10:21 ` Luca Boccassi
2018-05-10 12:23 ` Andy Green
2018-05-10 12:35 ` Luca Boccassi
2018-05-10 13:36 ` Bruce Richardson
2018-05-10 13:49 ` Luca Boccassi
2018-05-10 13:53 ` Andy Green
2018-05-10 14:20 ` Andy Green
2018-05-10 13:59 ` Andy Green
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=20180510091936.GB26838@jerin \
--to=jerin.jacob@caviumnetworks.com \
--cc=andy@warmcat.com \
--cc=dev@dpdk.org \
/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).