From: Willy Tarreau Date: Tue, 16 Oct 2018 15:57:36 +0000 (+0200) Subject: BUILD: lua: silence some compiler warnings after WILL_LJMP X-Git-Tag: v1.9-dev4~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b059b894cdf795f134b6e53ff95ea7f907feb846;p=thirdparty%2Fhaproxy.git BUILD: lua: silence some compiler warnings after WILL_LJMP These ones are on error paths that are properly handled by luaL_error() which does a longjmp() but the compiler cannot know it. By adding an __unreachable() statement in WILL_LJMP(), there is no ambiguity anymore. This may be backported to 1.8 but these previous patches are needed first : - BUILD: compiler: add a new statement "__unreachable()" - MINOR: lua: all functions calling lua_yieldk() may return - BUILD: lua: silence some compiler warnings about potential null derefs (#2) --- diff --git a/src/hlua.c b/src/hlua.c index f64a56477f..451d6863af 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -67,7 +68,7 @@ * MAY_LJMP() marks an lua function that may use longjmp. */ #define __LJMP -#define WILL_LJMP(func) func +#define WILL_LJMP(func) do { func; __unreachable(); } while(0) #define MAY_LJMP(func) func /* This couple of function executes securely some Lua calls outside of