locally disable some -Wpedantic via #pragma

Function pointers and void* probably can't well interact
when using -Wpedantic.
parent 692ebfd9
......@@ -599,6 +599,8 @@ static int l_trampoline(lua_State *L)
args = lua_tostring(L, 1);
}
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic" /* void* vs. function pointer */
if (callback == module->config) {
module->config(module, args);
} else {
......@@ -616,6 +618,7 @@ static int l_trampoline(lua_State *L)
json_delete(root_node);
return 1;
}
#pragma GCC diagnostic pop
/* No results */
return 0;
......@@ -912,6 +915,8 @@ void engine_stop(struct engine *engine)
/** Register module properties in Lua environment, if any. */
static int register_properties(struct engine *engine, struct kr_module *module)
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic" /* casts in lua_pushlightuserdata() */
if (!module->config && !module->props) {
return kr_ok();
}
......@@ -927,6 +932,7 @@ static int register_properties(struct engine *engine, struct kr_module *module)
}
}
lua_setglobal(engine->L, module->name);
#pragma GCC diagnostic pop
/* Register module in Lua env */
lua_getglobal(engine->L, "modules_register");
......
......@@ -81,6 +81,8 @@ const struct kr_module * kr_module_embedded(const char *name)
/** Load C module symbols. */
static int load_sym_c(struct kr_module *module, uint32_t api_required)
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic" /* casts after load_symbol() */
/* Check if it's embedded first */
const struct kr_module *embedded = kr_module_embedded(module->name);
if (embedded) {
......@@ -114,6 +116,7 @@ static int load_sym_c(struct kr_module *module, uint32_t api_required)
#undef ML
return kr_ok();
#pragma GCC diagnostic pop
}
int kr_module_load(struct kr_module *module, const char *name, const char *path)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment