mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 04:15:46 +00:00
lib: Wrapper a function to make gcc-10 happy
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 <sharpd@nvidia.com>
This commit is contained in:
parent
833c1f9fd1
commit
ea6caa1f52
11
lib/frrlua.h
11
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.
|
||||
*/
|
||||
|
@ -39,7 +39,7 @@ struct frrscript_codec frrscript_codecs_lib[] = {
|
||||
.encoder = (encoder_func)lua_pushintegerp,
|
||||
.decoder = lua_tointegerp},
|
||||
{.typename = "string",
|
||||
.encoder = (encoder_func)lua_pushstring,
|
||||
.encoder = (encoder_func)lua_pushstring_wrapper,
|
||||
.decoder = lua_tostringp},
|
||||
{.typename = "prefix",
|
||||
.encoder = (encoder_func)lua_pushprefix,
|
||||
|
Loading…
Reference in New Issue
Block a user