Re:What is “:-!!” in C code?
by an_account_name on Sunday November 20, 2016 @11:48PM
(#13003233)
Ah, neat. A version of static_assert for C. What kinds of expressions can it actually evaluate, though?
[ Parent
| on HN ]
Any constant expression. In the kernel it's mostly non-zero flags, sizes of things, etc. See https://github.com/torvalds/linux/search?utf8=%E2%9C%93&q=BU...
There's also a fun compile time check for arrays: https://github.com/torvalds/linux/blob/1001354ca34179f3db924...