4 ms·
You are correct. At least the do... while statement is a common c macro trick to make sure a macro has its own scope. The idea is that a compiler will optimize
by zambal 8y ago
You are correct. At least the do... while statement is a common c macro trick to make sure a macro has its own scope. The idea is that a compiler will optimize the do....while statement away, so it does not have any runtime overhead.
The wile...while(0) statement is new for me (didn't know this is actually legal syntax), but I suspect it's done for similar reasons.
- jwilk 8y ago> didn't know this is actually legal syntax It looks like some unusual looping syntax; but in fact these are just two normal while loops one after another.