From 8e5633a23f0b96a3fd6c00e4cc6c689bc47572df Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 3 Dec 2025 20:09:24 +0100 Subject: [PATCH] Blua: supress "-Wcast-qual" warnings from intentional casts --- src/blua/lapi.c | 5 ++++- src/blua/lvm.c | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/blua/lapi.c b/src/blua/lapi.c index fb1fe2898..0c78bc851 100644 --- a/src/blua/lapi.c +++ b/src/blua/lapi.c @@ -640,7 +640,8 @@ LUA_API void lua_getfenv (lua_State *L, int idx) { ** set functions (stack -> Lua) */ - +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-qual" static void auxsetstr (lua_State *L, const TValue *t, const char *k) { TValue key; const TValue *slot; @@ -671,6 +672,8 @@ LUA_API void lua_settable (lua_State *L, int idx) { lua_unlock(L); } +#pragma GCC diagnostic pop + LUA_API void lua_setfield (lua_State *L, int idx, const char *k) { lua_lock(L); diff --git a/src/blua/lvm.c b/src/blua/lvm.c index b43bbac72..dddd927cf 100644 --- a/src/blua/lvm.c +++ b/src/blua/lvm.c @@ -152,6 +152,8 @@ void luaV_finishget (lua_State *L, const TValue *t, TValue *key, StkId val, ** entry. (The value at 'slot' must be nil, otherwise 'luaV_fastset' ** would have done the job.) */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-qual" void luaV_finishset (lua_State *L, const TValue *t, TValue *key, StkId val, const TValue *slot) { int loop; /* counter to avoid infinite loops */ @@ -187,6 +189,7 @@ void luaV_finishset (lua_State *L, const TValue *t, TValue *key, } luaG_runerror(L, "settable chain too long; possible loop"); } +#pragma GCC diagnostic pop static int call_binTM (lua_State *L, const TValue *p1, const TValue *p2, @@ -407,6 +410,9 @@ static void Arith (lua_State *L, StkId ra, TValue *rb, } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-qual" + /* ** copy of 'luaV_gettable', but protecting call to potential metamethod ** (which can reallocate the stack) @@ -877,3 +883,5 @@ void luaV_execute (lua_State *L, int nexeccalls) { } } } + +#pragma GCC diagnostic pop