3 ms·
This is why I always use static_assert [0] to assert on the struct size in projects using C11+, or use a macro to create my own (using the negative array size t
by karlding 6y ago
This is why I always use static_assert [0] to assert on the struct size in projects using C11+, or use a macro to create my own (using the negative array size trick) to cause a compile error if I can't use C11 as a sanity check for these cases. This saves a lot of potential headaches.
[0] https://en.cppreference.com/w/c/language/_Static_assert https://en.cppreference.com/w/c/language/_Static_assert