【问题标题】:Doxygen in a .c-file.c 文件中的 Doxygen
【发布时间】:2013-06-25 16:58:04
【问题描述】:

我正在使用 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-文件中。

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

此结构的文档是从以下内容生成的 文件:命令行.c

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

【问题讨论】:

    标签: c doxygen


    【解决方案1】:

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

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

    另外,您可能想看看这篇文章,并提出类似的问题。

    using-doxygen-with-c-do-you-comment-the-function-prototype-or-the-definition? Or both?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-31
      • 2010-12-13
      • 2015-07-05
      • 2018-12-01
      • 1970-01-01
      相关资源
      最近更新 更多