BUILD: lua: silence a build warning with TCC
authorWilly Tarreau <w@1wt.eu>
Wed, 14 Jul 2021 17:41:25 +0000 (19:41 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 27 Jul 2021 06:36:40 +0000 (08:36 +0200)
TCC doesn't have the equivalent of __builtin_unreachable() and complains
that hlua_panic_ljmp() may return no value. Let's add a return 0 there.
All compilers that know that longjmp() doesn't return will see no change
and tcc will be happy.

(cherry picked from commit 6a510907807b7fb901654b4f5e5100aa91868fb7)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 69c66e3584ac81b70dd445ff56f8c9815de8f28c)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>

src/hlua.c

index ce36647..cb35a88 100644 (file)
 __decl_spinlock(hlua_global_lock);
 THREAD_LOCAL jmp_buf safe_ljmp_env;
 static int hlua_panic_safe(lua_State *L) { return 0; }
-static int hlua_panic_ljmp(lua_State *L) { WILL_LJMP(longjmp(safe_ljmp_env, 1)); }
+static int hlua_panic_ljmp(lua_State *L) { WILL_LJMP(longjmp(safe_ljmp_env, 1)); return 0; }
 
 #define SET_SAFE_LJMP(__L) \
        ({ \