diff --git a/src/libnm-std-aux/nm-std-aux.h b/src/libnm-std-aux/nm-std-aux.h index 5fe94bf799..a8b18ef1b2 100644 --- a/src/libnm-std-aux/nm-std-aux.h +++ b/src/libnm-std-aux/nm-std-aux.h @@ -293,9 +293,8 @@ _nm_assert_fail_internal(const char *assertion, #define NM_STATIC_ASSERT(cond) static_assert(cond, "") #define NM_STATIC_ASSERT_EXPR_1(cond) \ - (sizeof(struct { char __static_assert_expr_1[(cond) ? 1 : -1]; }) == 1) -#define NM_STATIC_ASSERT_EXPR_VOID(cond) \ - ((void) (sizeof(struct { char __static_assert_expr_void[(cond) ? 1 : -1]; }) == 1)) + (!!sizeof(struct { unsigned __static_assert_expr_1 : ((cond) ? 2 : -1); })) +#define NM_STATIC_ASSERT_EXPR_VOID(cond) ((void) NM_STATIC_ASSERT_EXPR_1(cond)) /*****************************************************************************/