I am trying to generate the documentation for a C project. The problem that I am facing is that the call graph is not generated for a function implemented between conditional macro, though if I remove the macro, the graph gets generated.
#if (defined (X) && (TRUE == X))
void TestFunction()
{
TestedFunction();
}
#endif
The tested function is defined in a header file inside the same conditional macro.
The following tags are set for doxygen:
ENABLE_PREPROCESSING = YES
ENABLE_PREPROCESSING = YES
SEARCH_INCLUDES = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
EXTRACT_ALL = NO
HAVE_DOT = YES
CALL_GRAPH = YES
CALLER_GRAPH = YES
DOT_PATH = $(GRAPHVIZ_DOT)
PREDEFINED = X=TRUE
OPTIMIZE_OUTPUT_FOR_C = YES
There are more functions that I test and the call graph gets correctly generated.
I also checked the output of the preprocessor and whether without or with the conditional macro, the output is the same, the parser receives the test function. I even wrote the TestFunction
between #if 1 ... #endif
and still no graph is generated.
Preprocessor output:
void TestFunction()
{
TestedFunction();
}
What I cant understand is how the call graph is generated when there is no #if ...
and is not generated when the macro is present, considering that the input for the parser is the same, based on the Preprocessor file.