diff options
author | Thomas Haller <thaller@redhat.com> | 2020-04-10 08:11:51 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-04-10 08:11:52 +0200 |
commit | 2c2ed2374fbdeb8f41236fa1f5d732b3b6339768 (patch) | |
tree | 266ed51b904d6d2fd4b5024056334ea1bb4760ab /shared/nm-glib-aux/nm-macros-internal.h | |
parent | be8be0f0918e62e72d37d79e8ae095bbf7c08710 (diff) | |
download | NetworkManager-2c2ed2374fbdeb8f41236fa1f5d732b3b6339768.tar.gz |
shared: fix static assert in NM_MORE_ASSERT_ONCE()
NM_MORE_ASSERTS 0 means that more assertions are disabled.
NM_MORE_ASSERT_ONCE() should never be triggered when more
assertions are disabled altogether. It is thus not allowed
to called "if (NM_MORE_ASSERT_ONCE (0))", because that code
would always be enabled.
Diffstat (limited to 'shared/nm-glib-aux/nm-macros-internal.h')
-rw-r--r-- | shared/nm-glib-aux/nm-macros-internal.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/shared/nm-glib-aux/nm-macros-internal.h b/shared/nm-glib-aux/nm-macros-internal.h index 9e3735d477..d5a8513e54 100644 --- a/shared/nm-glib-aux/nm-macros-internal.h +++ b/shared/nm-glib-aux/nm-macros-internal.h @@ -1046,7 +1046,7 @@ nm_str_realloc (char *str) && ({ \ static volatile int _assert_once = 0; \ \ - G_STATIC_ASSERT_EXPR ((more_assert_level) >= 0); \ + G_STATIC_ASSERT_EXPR ((more_assert_level) > 0); \ \ G_UNLIKELY ( _assert_once == 0 \ && g_atomic_int_compare_and_exchange (&_assert_once, 0, 1)); \ |