抑制特定的氧气警告

时间:2015-02-12 16:54:42

标签: c doxygen

似乎其他人之前已经问过这个问题。只想查看是否找到了答案。

我有几次出现以下情况:因为我正在记录各种功能,有时我会遇到我希望记录一些功能参数但不记录其他功能的情况。例如,

/** 
 * 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?

2 个答案:

答案 0 :(得分:0)

在这种情况下,我通常会写

@param self_explonatory

(只需声明param而不进行任何描述)。通常这很明智,因为参数然后在参数表中显示。

(不过,我真的很想提供一些选项,以在其他情况下暂时禁用警告…)

答案 1 :(得分:-2)

只记录self_explanatory参数,或者记住警告只是:警告。所有Doxygen都在告诉你,你可能会忽略一些事情。

您可以接受警告或忽略它。如果您确实要禁止该警告,则可能需要查看链接的第一个线程。具体而言,https://stackoverflow.com/a/25137529/3121160