[PATCH rdma-core] verbs: Fix warning from gcc-8

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



gcc-8 now warns on the void (*)(void) cast, use the less pedantically
correct (void *) cast instead.

../libibverbs/dummy_ops.c:526:28: warning: cast between incompatible function types from ‘struct ibv_pd * (* const)(struct ibv_context *)’ to ‘void * (*)(void)’ [-Wcast-function-type]
    (ptr)->_compat_##name = (void *(*)(void))ops->name;    \

Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
---
 libibverbs/dummy_ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libibverbs/dummy_ops.c b/libibverbs/dummy_ops.c
index 95869b364457ed..43f8430c8f43c5 100644
--- a/libibverbs/dummy_ops.c
+++ b/libibverbs/dummy_ops.c
@@ -523,7 +523,7 @@ void verbs_set_ops(struct verbs_context *vctx,
 	do {                                                                   \
 		if (ops->name) {                                               \
 			priv->ops.name = ops->name;                            \
-			(ptr)->_compat_##name = (void *(*)(void))ops->name;    \
+			(ptr)->_compat_##name = (void *)ops->name;             \
 		}                                                              \
 	} while (0)
 
-- 
2.18.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux