8
votes

It seems others have asked this question before. Just wanted to check and see if an answer had been found.

I have several occurrences of the following situation: as I am documenting various functions, sometimes I run into the situation where I wish to document some function parameters but not others. For example,

/** 
 * This is the brief description for the function.
 * And here is the detailed description.
 * @param foo This parameter is not self-explanatory and needs a blurb
 */
void some_function(void *foo, int self_explanatory) {
    // function does stuff
}

Adding the self_explanatory parameter to the Doxygen documentation just adds clutter, so I'd rather leave it out. However, Doxygen warns that the parameter is undocumented. I'm using Eclox, and it's annoying to have a bunch of warnings highlighted that I don't care about.

Right now, my doxyfile has the following options set:

EXTRACT_ALL          = YES
WARNINGS             = YES
WARN_IF_UNDOCUMENTED = NO
WARN_IF_DOC_ERROR    = YES
WARN_NO_PARAM_DOC    = NO

The warnings are still generated.

One option is to add @cond and @endcond surrounding the offending code, but then none of the documentation is generated for my function(s). I want the documentation, just not the warnings.

What I'm looking for is something like...

/** @nowarn
 * This is the brief description for the function.
 * And here is the detailed description.
 * @param foo This parameter is not self-explanatory and needs a blurb
 * @endnowarn
 */
void some_function(void *foo, int self_explanatory) {
    // function does stuff
}

... so that warnings are not generated in the enclosed code block.

Other SO questions I've found:
Suppressing Doxygen warnings
Suppress doxygen warning for undocumented member function, but leave synopsis in place
Is it possible to choose which Doxygen warning to show?

2

2 Answers

0
votes

In this case I usually write

@param self_explonatory

(just declare param without any description). This is usually sensible as param then shows in param table.

(still, I'd really like to have some option to disable warnings temporarily for other cases…)

-2
votes

Just document the self_explanatory parameter, or keep in mind that warnings are just that: warnings. All Doxygen is telling you is that there is something you might have overlooked.

You can take the warning or just ignore it. If you really want to suppress that warning, you might want to look in the first thread you linked. Specifically, https://stackoverflow.com/a/25137529/3121160.