From a2cb0198e1b8649707c577944b3fb4a80c3211e7 Mon Sep 17 00:00:00 2001 From: fengbojiang Date: Mon, 18 Sep 2023 17:38:55 +0800 Subject: [PATCH] Ignore a compilation warning of drivers mlx5. dlsym(if_indextoname) conversion of 'void *' pointer to function pointer type. --- dpdk/drivers/net/mlx5/linux/mlx5_ethdev_os.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dpdk/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/dpdk/drivers/net/mlx5/linux/mlx5_ethdev_os.c index b13a62a1f..ca8863576 100644 --- a/dpdk/drivers/net/mlx5/linux/mlx5_ethdev_os.c +++ b/dpdk/drivers/net/mlx5/linux/mlx5_ethdev_os.c @@ -1046,7 +1046,7 @@ mlx5_sysfs_check_switch_info(bool device_dir, * @return * 0 on success, a negative errno value otherwise and rte_errno is set. */ -static int (*real_if_indextoname)(unsigned int, char *); +static char *(*real_if_indextoname)(unsigned int, char *) = NULL; int mlx5_sysfs_switch_info(unsigned int ifindex, struct mlx5_switch_info *info) { @@ -1069,7 +1069,7 @@ mlx5_sysfs_switch_info(unsigned int ifindex, struct mlx5_switch_info *info) // for ff tools if (!real_if_indextoname) { - real_if_indextoname = dlsym(RTLD_NEXT, "if_indextoname"); + real_if_indextoname = __extension__ (char *(*)(unsigned int, char *))dlsym(RTLD_NEXT, "if_indextoname"); if (!real_if_indextoname) { rte_errno = errno; return -rte_errno;