Home > Net >  Macro function missing in call graph
Macro function missing in call graph

Time:01-13

Doxygen version used: 1.8.11

I have the following code:

void func();   

void main ()
{
    func();
}

When I run Doxygen graph generation, output is correct:

enter image description here

However, if I use a function macro:

void func();   
#define  MACRO func

void main ()
{
    MACRO();
}

Output is incorrect since the called function is missing:

enter image description here

How should I set preprocessor flags for this to work? Any combination I tried has failed so far.

Thanks


Edit: added code after preprocessing

# 1 "test.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "test.c"

void func();

void main ()
{
 func();
}

CodePudding user response:

If you have clang installed on your system, you can enable the CLANG_ASSISTED_PARSING option in the Doxyfile, which is more accurate but a bit slower than the doxygen builtin preprocessor. This generates the correct call graph on my system.

  •  Tags:  
  • Related