Y
Hacker News
new
|
ask
|
show
|
jobs
by
btrask
2040 days ago
do {} while(0) is a common idiom for macros in C, because it consumes the trailing semicolon, which a bare {} block doesn't do.
if(x) MACRO(); else something();
expands to
if(x) { ... }; // Error! else something();