What does !!(x) mean in C (esp. the Linux kernel)?
Posted
by Willi Ballenthin
on Stack Overflow
See other posts from Stack Overflow
or by Willi Ballenthin
Published on 2010-03-26T22:08:48Z
Indexed on
2010/03/26
22:23 UTC
Read the original article
Hit count: 232
I've been reading through the Linux kernel (specifically, 2.6.11). I came across the following definition:
#define unlikely(x) __builtin_expect(!!(x), 0)
(from linux-2.6.11/include/linux/compiler.h:61 lxr link)
What does !! accomplish? Why not just use (x)?
© Stack Overflow or respective owner