For example I'd like to make a debug macro which prints a code string before attempting to execute it. I suppose it should look something like that
#define TRACE(string) printf("Trying to execute: %s\n",\"string\"); \
string
...
void foo() {
printf("1\n");
}
void bar() {
printf("2\n");
}
int main() {
...
foo();
TRACE(bar(););
...
}
With expected output
...
1
Trying to execute: bar();
2
...
Well, THIS is not how one does it: compiler complains about illegal syntax. Is there a way to do it at all?