Blua: supress "-Wcast-qual" warnings

from intentional casts
This commit is contained in:
Alug committed 2025-12-03 20:09:32 +01:00
1 parent 8bcada1fda
commit 8e5633a23f
2 files changed
+12 -1

No files matched your search

+4 -1
View File
@@ -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);
+8
View File
@@ -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