Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to ignore `assert`ions in doxygen generated reference graphs?

Tags:

c

doxygen

In my code there are some assert calls to ensure that my functions are working properly, and to do some invariant-tests for datastructures.

Sometimes I use functions in the argument of assert and this functions then are in Doxygens callgraph of that function. For some bigger invarianttests this really polutes the graph…

How can I avoid that list_isSorted in the following snippet occurs in the callgraph?

int list_isElem (List l, Element e) {
  assert(list_isSorted(l));
  {
    if (list_isEmpty(l)) { return 0; }
    switch (compare(e, list_getValue(l))) {
    case -1: return 0;
    case  0: return 1;
    case  1: return list_isElem (list_getTail(l), e);
    default: exit(ERR_UNKNOWN);
    }
  }
}

I already tried to set PREDEFINED = NDEBUG in Doxyfile, but that did not work.

like image 356
NobbZ Avatar asked Nov 09 '22 20:11

NobbZ


1 Answers

just skip the assert?

see hhttp://www.doxygen.nl/manual/faq.html

"The new and easiest way is to add one comment block with a \cond command at the start and one comment block with a \endcond"

automate it with a macro:

#define DAssert(x) /** \cond */ assert(x) /** \endcond */
like image 96
Daij-Djan Avatar answered Nov 14 '22 22:11

Daij-Djan