News for hackers. Stuff that matters.
Re:What is your favorite C programming trick? (2009) by btrask on Sunday November 22, 2020 @08:29PM (#25182721)
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();

There are no comments on this comment yet.