nishant nair
nishant nair

Reputation: 21

Function documentation duplicated on prototypes in C++ header files -> Doxygen

Doxygen repeats function documentation when it encounters function prototypes in header files, for example:

code:

#include <File main.h>

void Func1(void);


///File main.c:

#include <main.h>

/*! Main program entry point. */
main()
{
    Func1();
}

/*! Test function which does nothing. */
void Func1(void)
{
    return;
}

generates two lots of documentation for Func1(): the first in the main.c documentation, and the second in the main.h documentation. With a large project, this almost doubles the size of the documentation with repeated, redundant function documentation. Is this a bug or some configuration problem?

Upvotes: 2

Views: 4366

Answers (3)

doxygen
doxygen

Reputation: 14869

If you set EXTRACT_ALL to NO and only document your header files using (/** @file */) then doxygen will only show the headers and still include the documentation found at the function's definition.

If you document both header and source file or set EXTRACT_ALL to YES, then doxygen will show the documentation of the function as part of the header and as part of the source file documentation. This is feature, not a bug :-)

Upvotes: 3

Ben Voigt
Ben Voigt

Reputation: 283634

Configure doxygen to group free functions by namespace, not by file.

Upvotes: 0

pmr
pmr

Reputation: 59811

You should duplicate the function prototype and not the implementation. But maybe just setting HIDE_UNDOC_MEMBERS to YES could fix your problem.

Upvotes: 0

Related Questions