12 void testStaticAssert (void)
14 /* sdcc always supports C11 _Static_assert, even though the earliest standard requiring it is C11. */
15 #if defined (__SDCC) || __STDC_VERSION__ >= 201112L
16 _Static_assert (1, "First assertion");
17 _Static_assert (sizeof(int), "Second assertion");
23 void testStaticAssert2X (void)
27 _Static_assert (sizeof(int));
33 void testAssert (void)
37 #ifdef __SDCC // SDCC assert is always C23-compliant
38 assert (a
[1, 0]); // C23 requires C23 to be implemented as variadic macro, which is meant for the use of compound literals in the argument. But the easiest way to test that is by using a comma operator not surrounded by ().