If I have a file like this:
#include <stdio.h>
#include <assert.h>
#include "mydefs-control.h"
#include "mydefs-value.h"
int main(void) {
assert(1 == 1);
printf("%d\n", MYDEF_VALUE_MACRO);
MYDEF_MACRO_WITH_CONTROL_FLOW();
}
My goal is to produce output which doesn't include thousands of lines from stdio.h and assert.h, doesn't expand assert() or MYDEF_VALUE_MACRO, and only expands MYDEF_MACRO_WITH_CONTROL_FLOW:
int main(void) {
assert(1 == 1);
printf("%d\n", MYDEF_VALUE_MACRO);
if (1) {
return 0;
} else {
return 1;
};
}
According to the author, having only the "interesting" stuff expanded makes it easier to reason about the control flow of the code.