Skip to content

gtestutils: Mark that g_assert_whatever() macros do not normally return

Philip Chimento requested to merge ptomato/glib:analyzer-noreturn into master

g_assert_true(), g_assert_cmpint(), and friends, can return to the caller if test_nonfatal_assertions is set, but this is normally not the case. In particular, for the purposes of static analysis, we specifically don't want to assume that they might return. Clang has an analyzer_noreturn attribute for this exact purpose, which conveniently already has a macro in gmacros.h.

Fixes: #1288 (closed) Fixes: #1200 (closed)

Edited by Philip Withnall

Merge request reports