[dpdk-dev] [PATCH] examples/quota_watermark: fix gcc 8.0.1 cast between incompatible types

Reshma Pattan reshma.pattan at intel.com
Wed May 9 13:35:28 CEST 2018


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 at dpdk.org

Signed-off-by: Reshma Pattan <reshma.pattan at intel.com>
---
 examples/quota_watermark/qw/main.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/examples/quota_watermark/qw/main.c b/examples/quota_watermark/qw/main.c
index 313216f39..dda3e0a3e 100644
--- a/examples/quota_watermark/qw/main.c
+++ b/examples/quota_watermark/qw/main.c
@@ -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);
 		}
 	}
-- 
2.14.3



More information about the dev mailing list