From ea6caa1f523a355cc95a1c73432e595f5ef4ec46 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sun, 24 Jan 2021 08:00:43 -0500 Subject: lib: Wrapper a function to make gcc-10 happy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gcc-10 is complaining: lib/frrscript.c:42:14: error: cast between incompatible function types from ‘const char * (*)(lua_State *, const char *)’ to ‘void (*)(lua_State *, const void *)’ [-Werror=cast-function-type] 42 | .encoder = (encoder_func)lua_pushstring, | ^ Wrapper it to make it happy. Not sure what else to do. Signed-off-by: Donald Sharp --- lib/frrlua.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/frrlua.h') diff --git a/lib/frrlua.h b/lib/frrlua.h index 8e52931e50..6fb30938b0 100644 --- a/lib/frrlua.h +++ b/lib/frrlua.h @@ -34,6 +34,17 @@ extern "C" { #endif +/* + * gcc-10 is complaining about the wrapper function + * not being compatible with lua_pushstring returning + * a char *. Let's wrapper it here to make our life + * easier + */ +static inline void lua_pushstring_wrapper(lua_State *L, const char *str) +{ + (void)lua_pushstring(L, str); +} + /* * Converts a prefix to a Lua value and pushes it on the stack. */ -- cgit v1.2.3