这个问题好像也有人问过。只是想检查一下是否找到了答案。
我有几次出现以下情况:当我记录各种函数时,有时我会遇到这样的情况,我希望记录一些函数参数而不是其他函数参数。例如,
/**
* 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
}
将 self_explanatory
参数添加到 Doxygen 文档只会增加困惑,所以我宁愿将其排除在外。但是,Doxygen 警告该参数未记录。我正在使用 Eclox,我不关心一堆突出显示的警告,这很烦人。
现在,我的 doxyfile 设置了以下选项:
EXTRACT_ALL = YES
WARNINGS = YES
WARN_IF_UNDOCUMENTED = NO
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAM_DOC = NO
仍然会生成警告。
一个选项是在有问题的代码周围添加 @cond
和 @endcond
,但是没有为我的函数生成任何文档。我想要文档,而不是警告。
我正在寻找的是...
/** @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 问题:
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?
最佳答案
在这种情况下我通常写
@param self_explonatory
(只声明参数,不做任何描述)。这通常是明智的,因为参数随后会显示在参数表中。
(不过,我真的很想有一些选项可以暂时禁用其他情况下的警告......)
关于c - 抑制特定的氧气警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28483249/