'luaL_newstate' starts state with warnings on

It is easier to forget to turn them on then to turn them off.
This commit is contained in:
Roberto I
2025-12-13 11:00:30 -03:00
parent 82d721a855
commit 3d03ae5bd6
2 changed files with 3 additions and 2 deletions

View File

@@ -1185,7 +1185,7 @@ LUALIB_API lua_State *(luaL_newstate) (void) {
lua_State *L = lua_newstate(luaL_alloc, NULL, luaL_makeseed(NULL));
if (l_likely(L)) {
lua_atpanic(L, &panic);
lua_setwarnf(L, warnfoff, L); /* default is warnings off */
lua_setwarnf(L, warnfon, L);
}
return L;
}