Recently, I am tracing some source code. I stuck when I saw following macro.
#define tmp(x) \
((void) ((struct { \
_Static_assert(sizeof(x) <= 16, "Err"); \
int dum; \
}){1})
This macro is for checking whether the size of x is less than 16.
I have two question about this macro.
First, what is struct in following format meaning, did this style has key word?
(struct {
.......
}){1};
Second, why it put assert inside struct? Why not just call _Static_assert in main?