3 ms·
The real oddity of this macro is the parentheses around the block, which cause it to behave much like an inline function (but without having to wrestle the type
by blasdel 18y ago
The real oddity of this macro is the parentheses around the block, which cause it to behave much like an inline function (but without having to wrestle the type system).
- deleted 18y ago[deleted]
- deleted 18y ago[deleted]
- yan 18y agoIt's also cleaner than the do { ... } while(0) business, imho.
- tspiteri 18y agodo { ... } while(0) is Ansi C and has type void. ({ ... }) is a GCC extension and its value is the value of the last expression inside the block. So they have different uses.