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

There are several assert calls in my code to ensure that my functions work correctly and perform some invariant tests for datastructures.

Sometimes I use functions in the assert argument, and these functions are then found in the Doxgens callgraph of this function. For some larger invariant tests, this really interprets the graph ...

How can I avoid that list_isSorted in the following snippet happens in 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 setting PREDEFINED = NDEBUG to a Doxyfile, but that didn't work.

+5
source share
1 answer

just skip the statement?

see http://www.stack.nl/~dimitri/doxygen/manual/faq.html

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

automate it with a macro:

 #define DAssert(x) /** \cond */ assert(x) /** \endcond */ 
+1
source

Source: https://habr.com/ru/post/1210789/


All Articles