0

我正在使用 doxygen 来评论一个纯 C 项目。结构的文档具有以下形式:

 /** @struct cl_options
 *  @brief This structure contains all ...
 *  @var cl_options::input_file
 *  Member 'input_file' contains ...
 *  @var cl_options::output_file
 *  Member 'output_file' contains ...
 *  @var cl_options::bitrate_mode
 *  ...
 */
struct cl_options {
    FILE* input_file;
    FILE* output_file;
        ....
};

不过我收到警告:

.../commandline.c:39: Warning: Member input_file (variable) of class cl_options is not documented.
.../commandline.c:40: Warning: Member output_file (variable) of class cl_options is not documented.

等等。对于项目中的所有结构。

头文件 commandline.h 中有一个 decleration

struct cl_options;
typedef struct cl_options cl_options;

但 doxygen 在.c-File 中。

现在生成的 doxygen 在数据结构部分有一个结构的链接,但没有记录。相反,有一个链接说

此结构的文档是从以下文件生成的:commandline.c

然后是我在.c-file 中提供的文档。我怎样才能避免这种情况?

4

1 回答 1

1

在使用 doxygen 时,我自己注意到了很多警告,但是大多数时候输出对我来说似乎没问题。您可以打开和关闭不同的警告。有关更多信息,请访问doxygen 手册并选择要启用的警告。

但是,您可以尝试将@var标签从.c文件移动到.h标题中。只需将结构中的功能文档留在.c.

此外,您可能想看看这个帖子,有一个类似的问题。

using-doxygen-with-c-do-you-comment-the-function-prototype-or-the-definition?或两者?

于 2013-06-25T23:22:06.047 回答