Building GLib with G_DISABLE_ASSERT fails
from glib/gtestutils.h comment:
/* While we discourage its use, g_assert() is often used in unit tests * (especially in legacy code). g_assert_*() should really be used instead. * g_assert() can be disabled at client program compile time, which can render * tests useless. Highlight that to the user. */
So according to this comment building glib with -DG_DISABLE_ASSERT and people should be using g_assert_() instead g_assert(). However looks like glib themselves is no longer compliant with this comment. First during release and plain build is executes gtester selftest. When I've disabled firing this test next build of the gterter is failing:
../glib/gtestutils.h:222:5: error: implicit declaration of function ‘exit’ [-Werror=implicit-function-declaration] 222 | exit (1); \ | ^~~~
As up to now it was possible to reduce dramatically glib libraries size by use -DG_DISABLE_ASSERT I'm still trying to use this in latest version. Generally speaking glib compiled with -DG_DISABLE_ASSERT was working correctly. Only in few projects test suites have been complaining that glib is compiled with -DG_DISABLE_ASSERT. I've even been able to convince some maintainers to not depend on -DG_DISABLE_ASSERT.
IMO release build should be build with -DG_DISABLE_ASSERT and -DG_DISABLE_CHECKS and plain build with -DG_DISABLE_CHECKS, and only debug one should be build without -DG_DISABLE_ASSERT and -DG_DISABLE_CHECKS.