From 6e9778c88af6a290e81bcfda12d6d45c92b931b5 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sun, 24 Jul 2016 13:41:00 +0200 Subject: [PATCH] memcached plugin: fix compiler warning on Solaris | ud.free_func = (void *) memcached_free; | ^ line 559, memcached.c assignment type mismatch: pointer to function(pointer to void) returning void "=" pointer to void Casting a function pointer to a void pointer is undefined behaviour in C (it is defined in POSIX however) --- src/memcached.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/memcached.c b/src/memcached.c index 62ac72a8..54e3a190 100644 --- a/src/memcached.c +++ b/src/memcached.c @@ -52,8 +52,9 @@ typedef struct memcached_s memcached_t; static _Bool memcached_have_instances = 0; -static void memcached_free (memcached_t *st) +static void memcached_free (void *arg) { + memcached_t *st = arg; if (st == NULL) return; @@ -556,7 +557,7 @@ static int memcached_add_read_callback (memcached_t *st) memset (&ud, 0, sizeof (ud)); ud.data = st; - ud.free_func = (void *) memcached_free; + ud.free_func = memcached_free; assert (st->name != NULL); ssnprintf (callback_name, sizeof (callback_name), "memcached/%s", st->name); -- 2.30.2