":-!!" is not a single operator but four separate operators.
! is a logical negation
So for example !3 evaluates to zero.
!0 evaluates to 1.
Therefore !!3 evaluates to 1.
"-" takes the negative of that number.
The colon after an int in a struct definition defines the size of a bitfield.
int:0 is used to align the next structure member to the next int boundary.
unsigned char:0 will align the next structure member to the next byte boundary.
So, in the struct:
struct { unsigned char something:3;
unsigned char:0;
unsigned char something_else;};
something takes up 3 bits, and something_else takes up 8, but something_else starts on the next byte boundary, thanks to the unsigned char:0; member in between the two. It's a way of forcing data alignment.
So, you can't have a negative number for the size of a bit field...UNLESS THAT NUMBER IS ZERO.
What happens when that number is zero?
-0 == 0. Only number for which that is true.
Here we go. So if you define a macro that defines a structure with a single element
int:-!!(e);
And 'e' evaluates to anything other than 0, it will produce a build error. It won't compile.
The purpose of using this construct (perverse as it is) is to make sure code where 'e' does not evaluate to 0 does not even compile. It's a way of keeping bad code out of your operating system.
But (as the documentation says) it will produce a return result if e IS zero.
The question often arises -- why don't you just use an 'assert' or a 'try' or ...
Yah. Those things work great if you've got a functional operating system. But look at where this is being used: IN the operating system code: kernel.h.
You run out of bounds on that, and you no longer have a computer -- you've got bricked metal. So the idea behind using a construct like this are situations where you really need to prevent certain code from even compiling.