]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: lua: silence a build warning with TCC
authorWilly Tarreau <w@1wt.eu>
Wed, 14 Jul 2021 17:41:25 +0000 (19:41 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 14 Jul 2021 17:41:25 +0000 (19:41 +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.

src/hlua.c

index 2ad3d19bd195fd7d149952fe9707673fe3cab559..f7100465bacb0c09328c94b0acce0d83ba0ce599 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; }
 
 /* This is the chained list of struct hlua_function referenced
  * for haproxy action, sample-fetches, converters, cli and