build: add --enable-more-asserts configure option and nm_assert() macro
authorThomas Haller <thaller@redhat.com>
Fri, 10 Apr 2015 05:25:03 +0000 (07:25 +0200)
committerThomas Haller <thaller@redhat.com>
Fri, 10 Apr 2015 16:06:59 +0000 (18:06 +0200)
commit08ecafd2bf672e3e49a90f22dd87fabfa08f4e2c
treeeaff5772c385bfab79a7244be5b1b7fa2d494b70
parent4ab540939c424ade6cf6eb40cf0d79ec8a17101f
build: add --enable-more-asserts configure option and nm_assert() macro

NM already has two kinds of assertions:
 - g_assert*(), conditionally compiled via #ifndef G_DISABLE_ASSERT
 - g_return*(), conditionally compiled via #ifndef G_DISABLE_CHECKS

In theory, one should be able to disable both asserts and NM should
still work correctly (and possibly more efficient). In practice,
hardly anybody is testing such a configuration and it might be broken.
Especially, we don't disable asserts for production builds, both because
of less test coverage and because it might reduce our ability to debug.

Add a new configure option --enable-more-asserts, which defines
NM_MORE_ASSERTS and nm_assert(). This is for expensive asserts,
that -- contrary to the asserts above -- are disabled by default.
This is useful for extended debugging.
configure.ac
include/nm-utils-internal.h