From b59c46fd2f2c5d094ad9d7b72fec772b99356419 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sun, 3 May 2020 16:19:23 +0100 Subject: [PATCH 1/1] lib/macros.c: Use `void (*)(void)' as the universal function-pointer. Newer versions of GCC complain about all kinds of explicit function- pointer conversions unless (a) the arguments are /really/ similar, or (b) they're to this specific `universal' function-pointer type. The code which sets and uses these things looks safe to use, so I don't think we need any further countermeasures. --- lib/macros.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/macros.c b/lib/macros.c index e11c264..3639bcb 100644 --- a/lib/macros.c +++ b/lib/macros.c @@ -63,7 +63,7 @@ struct expansion { /** @brief Callback (cast to appropriate type) * * Cast to @ref mx_simple_callback or @ref mx_magic_callback as required. */ - void (*callback)(); + void (*callback)(void); /** @brief Macro definition * @@ -332,7 +332,7 @@ static int mx__register(unsigned flags, int min, int max, char **args, - void (*callback)(), + void (*callback)(void), const struct mx_node *definition) { struct expansion e[1]; @@ -357,7 +357,7 @@ void mx_register(const char *name, int min, int max, mx_simple_callback *callback) { - mx__register(EXP_SIMPLE, name, min, max, 0, (void (*)())callback, 0); + mx__register(EXP_SIMPLE, name, min, max, 0, (void (*)(void))callback, 0); } /** @brief Register a magic expansion rule @@ -370,7 +370,7 @@ void mx_register_magic(const char *name, int min, int max, mx_magic_callback *callback) { - mx__register(EXP_MAGIC, name, min, max, 0, (void (*)())callback, 0); + mx__register(EXP_MAGIC, name, min, max, 0, (void (*)(void))callback, 0); } /** @brief Register a macro -- 2.11.0