From d7a8c573cf4bfcced97cf9b9ac754c120c968f02 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 20 Jun 2022 19:53:58 +0000 Subject: 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 Reviewed-by: Alexander Motin Signed-off-by: Brian Behlendorf Closes #13528 Closes #13575 --- module/lua/ldo.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'module/lua') diff --git a/module/lua/ldo.c b/module/lua/ldo.c index f3c3dcb4d..821c42875 100644 --- a/module/lua/ldo.c +++ b/module/lua/ldo.c @@ -168,6 +168,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? */ @@ -190,6 +197,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; -- cgit v1.2.3