Silence -Winfinite-recursion warning in luaD_throw()

This code should be kept inline with the upstream lua version as much
as possible.  Therefore, we simply want to silence the warning.  This
check was enabled by default as part of -Wall in gcc 12.1.

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13528
Closes #13575
This commit is contained in:
Brian Behlendorf
2022-06-20 19:53:58 +00:00
parent 80a650b7bb
commit a6e8113fed
3 changed files with 35 additions and 0 deletions
+11
View File
@@ -167,6 +167,13 @@ static void seterrorobj (lua_State *L, int errcode, StkId oldtop) {
L->top = oldtop + 1;
}
/*
* Silence infinite recursion warning which was added to -Wall in gcc 12.1
*/
#if defined(HAVE_INFINITE_RECURSION)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Winfinite-recursion"a
#endif
l_noret luaD_throw (lua_State *L, int errcode) {
if (L->errorJmp) { /* thread has an error handler? */
@@ -189,6 +196,10 @@ l_noret luaD_throw (lua_State *L, int errcode) {
}
}
#if defined(HAVE_INFINITE_RECURSION)
#pragma GCC diagnostic pop
#endif
int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) {
unsigned short oldnCcalls = L->nCcalls;