From 12aef961a2f4119bd63526b31c7241156555064d Mon Sep 17 00:00:00 2001 From: Henry Gabryjelski <740168+henrygab@users.noreply.github.com> Date: Wed, 3 Sep 2025 15:49:55 -0700 Subject: [PATCH] _Static_assert() requires message At least until C23, even if GCC allows it w/o errors being raised. --- client/src/wiegand_formats.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/wiegand_formats.c b/client/src/wiegand_formats.c index 4462b9c1f..0f3656ea4 100644 --- a/client/src/wiegand_formats.c +++ b/client/src/wiegand_formats.c @@ -717,9 +717,9 @@ static const uint8_t S12906b_odd_parity_bit_0[] = { 1, 2, 4, 5, 7, 8, 1 static const uint8_t S12906b_even_parity_bit_9[] = { 2, 3, 5, 6, 8, 11, 13, 14, 16, 17, 19, 20, 22, 23, 25, 26, 28, 29, 31, 32, 34, 35 }; static const uint8_t S12906b_even_parity_bit_10[] = { 1, 3, 4, 6, 7, 11, 12, 14, 15, 17, 18, 20, 21, 23, 24, 26, 27, 29, 30, 32, 33, 35 }; #define S12906b_BITS_USED_BY_PARITY (22u) -_Static_assert((sizeof( S12906b_odd_parity_bit_0 ) / sizeof( S12906b_odd_parity_bit_0 [0])) == S12906b_BITS_USED_BY_PARITY); -_Static_assert((sizeof(S12906b_even_parity_bit_9 ) / sizeof(S12906b_even_parity_bit_9 [0])) == S12906b_BITS_USED_BY_PARITY); -_Static_assert((sizeof(S12906b_even_parity_bit_10) / sizeof(S12906b_even_parity_bit_10[0])) == S12906b_BITS_USED_BY_PARITY); +_Static_assert((sizeof( S12906b_odd_parity_bit_0 ) / sizeof( S12906b_odd_parity_bit_0 [0])) == S12906b_BITS_USED_BY_PARITY, "Wrong array length"); +_Static_assert((sizeof(S12906b_even_parity_bit_9 ) / sizeof(S12906b_even_parity_bit_9 [0])) == S12906b_BITS_USED_BY_PARITY, "Wrong array length"); +_Static_assert((sizeof(S12906b_even_parity_bit_10) / sizeof(S12906b_even_parity_bit_10[0])) == S12906b_BITS_USED_BY_PARITY, "Wrong array length"); static bool Pack_S12906b(int format_idx, wiegand_card_t *card, wiegand_message_t *packed, bool preamble) { memset(packed, 0, sizeof(wiegand_message_t));