Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on C23: A Slightly Better C. Parent comment
Consider this:
if (e) SWAP(a, b); else something_else();
if (e) do { // ...macro... } while(0); else something_else();
// One-armed if-statement if (e) { // ...macro... } // Empty statement ; // Another statement else something_else();
Consider this:
Currently, that expands to this, which is still valid code: If it were just wrapped in braces, the code would be parsed like this: It's incorrect syntax to start a statement with else, so the compiler will say something like "Unexpected 'else' at line N."