Skip to content

Commit 5cd35d3

Browse files
committed
_Static_assert() requires message
At least until C23, even if GCC allows it w/o errors being raised.
1 parent 3ea19bd commit 5cd35d3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

client/src/wiegand_formats.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -717,9 +717,9 @@ static const uint8_t S12906b_odd_parity_bit_0[] = { 1, 2, 4, 5, 7, 8, 1
717717
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 };
718718
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 };
719719
#define S12906b_BITS_USED_BY_PARITY (22u)
720-
_Static_assert((sizeof( S12906b_odd_parity_bit_0 ) / sizeof( S12906b_odd_parity_bit_0 [0])) == S12906b_BITS_USED_BY_PARITY);
721-
_Static_assert((sizeof(S12906b_even_parity_bit_9 ) / sizeof(S12906b_even_parity_bit_9 [0])) == S12906b_BITS_USED_BY_PARITY);
722-
_Static_assert((sizeof(S12906b_even_parity_bit_10) / sizeof(S12906b_even_parity_bit_10[0])) == S12906b_BITS_USED_BY_PARITY);
720+
_Static_assert((sizeof( S12906b_odd_parity_bit_0 ) / sizeof( S12906b_odd_parity_bit_0 [0])) == S12906b_BITS_USED_BY_PARITY, "Wrong array length");
721+
_Static_assert((sizeof(S12906b_even_parity_bit_9 ) / sizeof(S12906b_even_parity_bit_9 [0])) == S12906b_BITS_USED_BY_PARITY, "Wrong array length");
722+
_Static_assert((sizeof(S12906b_even_parity_bit_10) / sizeof(S12906b_even_parity_bit_10[0])) == S12906b_BITS_USED_BY_PARITY, "Wrong array length");
723723

724724
static bool Pack_S12906b(int format_idx, wiegand_card_t *card, wiegand_message_t *packed, bool preamble) {
725725
memset(packed, 0, sizeof(wiegand_message_t));

0 commit comments

Comments
 (0)