]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUILD: haproxy: mark deinit_and_exit() as noreturn
authorWilly Tarreau <w@1wt.eu>
Mon, 15 Jun 2020 16:43:46 +0000 (18:43 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 15 Jun 2020 16:43:46 +0000 (18:43 +0200)
commitf3ca5a0273e73a7b213eb09cb3dc5856648b86c3
tree44184eaa2d784b9460389a1e96d9ca954e81fb09
parent55ae1ab9e46bb8c10931cadfe685319e4fa9170c
BUILD: haproxy: mark deinit_and_exit() as noreturn

Commit 0a3b43d9c ("MINOR: haproxy: Make use of deinit_and_exit() for
clean exits") introduced this build warning:

  src/haproxy.c: In function 'main':
  src/haproxy.c:3775:1: warning: control reaches end of non-void function [-Wreturn-type]
   }
   ^

This is because the new deinit_and_exit() is not marked as "noreturn"
so depending on the optimizations, the noreturn attribute of exit() will
either leak through it and silence the warning or not and confuse the
compiler. Let's just add the attribute to fix this.

No backport is needed, this is purely 2.2.
include/haproxy/global.h
src/haproxy.c