Is there a compile-time form of ASSERT() available in KDS? It would be handy when checking on size of packed bit arrays, or the address of system registers, etc.
I am using a "polyfill" version of STATIC_ASSERT() from Compile time assertions in C , but it would be great if there was a natively supported version instead.
I just stumbled across the answer: yes there is:
_Static_assert(1==2, "whoa");
...will cause the compilation to fail with a message of the form:
In ../sources/assert_test.h:194:1: error: static assertion failed: "whoa"
_Static_assert(1==2, "whoa");
On the other hand,
_Static_assert(1==1, "whoa");
... will compile without error.