From 2c2ed2374fbdeb8f41236fa1f5d732b3b6339768 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 10 Apr 2020 08:11:51 +0200 Subject: [PATCH] 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. --- shared/nm-glib-aux/nm-macros-internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); \