79822580

Date: 2025-11-17 17:20:40
Score: 0.5
Natty:
Report link

As mentioned in other answers, static_assert() in C11 is doing exactly that. In earlier C versions it can be "simulated" with some compiler black magic:

#define static_assert(condition, text) ((void)sizeof(char[1 - 2 * !(condition)]))

This works exactly like the C11 version apart from the less elegant error message.

Reasons:
  • No code block (0.5):
Posted by: vjalle