On stack overflow I ran into a question What is ":-!!" in C code?
> #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
> #define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); }))
out of curiosity I want to know how can I use these kind of macros ?
int main()
{
BUILD_BUG_ON_ZERO(0);
return 0;
}
In the above code it gives an error that type name is not allowed.
EDIT : the code compiles on linux using gcc but fails on visual studio