4 ms·
The comma operator is pretty useful in macros: #define something(...) (printf(... some debug message ...),real_something_expression) foo = something(..
by antirez 15y ago
The comma operator is pretty useful in macros:
#define something(...) (printf(... some debug message ...),real_something_expression)
foo = something(...)
This way you can create macros returning values and printing debug messages at the same time.
- koopajah 15y agoThis is what I was going to post, comma operator is really useful in macro for example when overriding mutex lock/unlock to call printf before and still keep the returned value and not change all calls.