c preprocessor - C #define macro for debug printing - Stack Overflow
I use something like this: #ifdef DEBUG #define D if(1) #else #define D if(0) #endif Than I just use D as a prefix: D printf("x=%0.3f\n",x); Compiler sees the debug code, there is no comma problem and it works everywhere. Also it works when printf is ...