I have 3 files:
test.c
int table[] = {
#define X(val) val,
#include "test.x"
#undef X
};
void level2(void) {
level3();
level4();
}
void level3(void) {
level4();
}
test2.c
void level1(void) {
level2();
level3();
level4();
}
void level4(void) {
}
test.x
X(1)
X(2)
X(3)
I use doxygen to create callgraphs for these functions. Here's what I expected:
- level1:
- References level2(), level3(), and level4().
- level2:
- References level3(), and level4().
- Referenced by level1().
- level3:
- References level4().
- Referenced by level1(), and level2().
- level4:
- Referenced by level1(), level2(), and level3().
But here is what I got:
- level1:
- References level2(), level3(), and level4().
- level2:
- Referenced by level1().
- level3:
- Referenced by level1().
- level4:
- Referenced by level1().
It seems X-macro on test.c is the culprit. I managed to make it work by doing 2 things (either will do):
- Renaming
test.x
so doxygen doesn't find it. It will show warning, but callgraph is correct. - Adding trailing newline at the end of
test.x
. Normally file would end immediately afterX(3)
.
Question:
How can I get reliable callgraph out of doxygen without editing the files? Is there a setting I need to change or is this plain bug?