[dpdk-dev] examples/quota_watermark: fix gcc 8.0.1 cast between incompatible types
Checks
Commit Message
Gcc 8.0.1 reports incompatible cast between types i.e. from
`void (*)(void *)` to `(int (*)(void *)`.
Change the pipeline_stage prototype to retun int type
to fix the issue.
Fixes: a0ffcb257a ("examples/quota_watermark: correct code indentation")
CC: stable@dpdk.org
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
---
examples/quota_watermark/qw/main.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
Comments
> -----Original Message-----
> From: stable [mailto:stable-bounces@dpdk.org] On Behalf Of Reshma Pattan
> Sent: Wednesday, May 9, 2018 12:35 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Pattan, Reshma <reshma.pattan@intel.com>
> Subject: [dpdk-stable] [PATCH] examples/quota_watermark: fix gcc 8.0.1 cast
> between incompatible types
>
> Gcc 8.0.1 reports incompatible cast between types i.e. from `void (*)(void *)` to
> `(int (*)(void *)`.
>
> Change the pipeline_stage prototype to retun int type to fix the issue.
>
> Fixes: a0ffcb257a ("examples/quota_watermark: correct code indentation")
> CC: stable@dpdk.org
>
> Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
09/05/2018 13:35, Reshma Pattan:
> Gcc 8.0.1 reports incompatible cast between types i.e. from
> `void (*)(void *)` to `(int (*)(void *)`.
>
> Change the pipeline_stage prototype to retun int type
> to fix the issue.
>
> Fixes: a0ffcb257a ("examples/quota_watermark: correct code indentation")
> CC: stable@dpdk.org
>
> Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> ---
> /* typecast is a workaround for GCC 4.3 bug */
> - rte_eal_remote_launch((int (*)(void *))pipeline_stage,
> + rte_eal_remote_launch(pipeline_stage,
> NULL, lcore_id);
The comment can be removed.
Applied with above fixed, thanks
@@ -181,7 +181,7 @@ receive_stage(__attribute__((unused)) void *args)
}
}
-static void
+static int
pipeline_stage(__attribute__((unused)) void *args)
{
int i, ret;
@@ -243,9 +243,11 @@ pipeline_stage(__attribute__((unused)) void *args)
}
}
}
+
+ return 0;
}
-static void
+static int
send_stage(__attribute__((unused)) void *args)
{
uint16_t nb_dq_pkts;
@@ -287,6 +289,8 @@ send_stage(__attribute__((unused)) void *args)
/* TODO: Check if nb_dq_pkts == nb_tx_pkts? */
}
}
+
+ return 0;
}
int
@@ -347,7 +351,7 @@ main(int argc, char **argv)
init_ring(lcore_id, port_id);
/* typecast is a workaround for GCC 4.3 bug */
- rte_eal_remote_launch((int (*)(void *))pipeline_stage,
+ rte_eal_remote_launch(pipeline_stage,
NULL, lcore_id);
}
}