]> git.ipfire.org Git - thirdparty/systemd.git/commit
coverity: Add custom assertion macros for Coverity
authorFilipe Brandenburger <filbranden@google.com>
Wed, 18 Jul 2018 02:43:20 +0000 (19:43 -0700)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 19 Jul 2018 07:07:25 +0000 (09:07 +0200)
commitd9fb7afb4890a93db478616e7bfc639b2129b466
treeb0b77f733dfcc1c7116289e8dbfa5c5194a70c2e
parent6a8b23058553ed6a207c22f13ea67d77ed2013d4
coverity: Add custom assertion macros for Coverity

These custom macros make the expression go through a function, in order
to prevent ASSERT_SIDE_EFFECT false positives on our macros such as
assert_se() and assert_return() that cannot be disabled and will always
evaluate their expressions.

This technique has been described and recommended in:
https://community.synopsys.com/s/question/0D534000046Yuzb/suppressing-assertsideeffect-for-functions-that-allow-for-sideeffects

Tested by doing a local cov-build and uploading the resulting tarball to
scan.coverity.com, confirmed that the ASSERT_SIDE_EFFECT false positives
were gone.
src/basic/macro.h