]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/basic/macro.h
macro: use __builtin_unreachable on NDEBUG
authorNRK <nrk@disroot.org>
Mon, 2 Oct 2023 13:25:00 +0000 (19:25 +0600)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 3 Oct 2023 19:34:38 +0000 (21:34 +0200)
commitbe1666886b3f4355ab33f571187e3de8aae3ad40
treec4bbfad5e8940b9b357f9a5641d9f12f4d16c1c2
parentdb5d86f5b9fd86231e841df5dc8d0fd993e00761
macro: use __builtin_unreachable on NDEBUG

note that this slightly changes the semantic of assert when NDEBUG is
defined. if there's an extern function call (without attribute pure or
similar) then the compiler has to assume it has side effects and still
emit the function call.

whereas the old assert guaranteed that nothing will be evaluated on
NDEBUG.

Closes: https://github.com/systemd/systemd/issues/29408
src/basic/macro.h
src/fundamental/macro-fundamental.h