4 ms·
What he means is, you want to use them in a macro. You can't get the effect you probably want by using them in a function. Compare: #define LOG_ERROR() pri
by jstimpfle 9y ago
What he means is, you want to use them in a macro. You can't get the effect you probably want by using them in a function. Compare:
#define LOG_ERROR() printf("ERROR at %s:%d\n", __FILE__, __LINE__)
void logError(void) { printf("ERROR at %s:%d\n", __FILE__, __LINE__); }
- tomsmeding 9y agoSure, they are pretty useless in a function. But that doesn't mean that the author can go and use incorrect language. :P
- AstralStorm 9y agoExcept when they work properly when fully inlined. (Sprinkle GCC/Clang magic here. It is required to make it work.)
- tomsmeding 9y agoIs that even possible? It shouldn't be without extensions. (But that seems to be what you're implying anyway.)