在 C++ 中使用 Doxygen 和 GraphViz 的错误 call/caller 图
Wrong call/caller graph with Doxygen and GraphViz in C++
所以我开始使用 Doxygen 1.8.13(Windows 10、64 位)记录一个 C++ 项目,并遇到了 GraphViz 的 call/caller 图形生成问题。
如果使用以下代码生成文档,Doxygen 将生成如下所示的调用图:
但是如代码所示,Path() 不调用任何函数(空主体)。
struct Path {
Path(const Node* source_node, const Node* target_node,
const unsigned long cost, const std::vector<const Node*> path)
: source_node(source_node), target_node(target_node),
cost(cost), path(path), length(path.size()) { };
void printCompletePath(std::ostream& = std::cout) const;
const Node* source_node = nullptr;
const Node* target_node = nullptr;
const unsigned long cost = 0;
const std::vector<const Node*> path{};
const std::vector<const Node*>::size_type length = 0;
};
但是如果我按如下方式重新排序代码,调用图就会消失(如预期的那样):
struct Path {
Path(const Node* source_node, const Node* target_node,
const unsigned long cost, const std::vector<const Node*> path)
: source_node(source_node), target_node(target_node),
cost(cost), path(path), length(path.size()) { };
const Node* source_node = nullptr;
const Node* target_node = nullptr;
const unsigned long cost = 0;
const std::vector<const Node*> path{};
const std::vector<const Node*>::size_type length = 0;
void printCompletePath(std::ostream& = std::cout) const;
};
那是 Doxygen and/or GraphViz 错误吗?或者我错过了什么?
(我不想为了 Doxygen 的工作而重新排序我的源代码。)
在 1.8.13 版本中,我可以重现有关调用图的问题。在 1.8.14 版本中,这个错误的调用图消失了。
来自 doxygen 更改日志:函数定义后的函数声明被错误地列为调用依赖 [https://github.com/doxygen/doxygen/commit/436fc7ed1158d517dd6f6d25aa3e05568f8c3d94]
所以我开始使用 Doxygen 1.8.13(Windows 10、64 位)记录一个 C++ 项目,并遇到了 GraphViz 的 call/caller 图形生成问题。
如果使用以下代码生成文档,Doxygen 将生成如下所示的调用图:
但是如代码所示,Path() 不调用任何函数(空主体)。
struct Path {
Path(const Node* source_node, const Node* target_node,
const unsigned long cost, const std::vector<const Node*> path)
: source_node(source_node), target_node(target_node),
cost(cost), path(path), length(path.size()) { };
void printCompletePath(std::ostream& = std::cout) const;
const Node* source_node = nullptr;
const Node* target_node = nullptr;
const unsigned long cost = 0;
const std::vector<const Node*> path{};
const std::vector<const Node*>::size_type length = 0;
};
但是如果我按如下方式重新排序代码,调用图就会消失(如预期的那样):
struct Path {
Path(const Node* source_node, const Node* target_node,
const unsigned long cost, const std::vector<const Node*> path)
: source_node(source_node), target_node(target_node),
cost(cost), path(path), length(path.size()) { };
const Node* source_node = nullptr;
const Node* target_node = nullptr;
const unsigned long cost = 0;
const std::vector<const Node*> path{};
const std::vector<const Node*>::size_type length = 0;
void printCompletePath(std::ostream& = std::cout) const;
};
那是 Doxygen and/or GraphViz 错误吗?或者我错过了什么? (我不想为了 Doxygen 的工作而重新排序我的源代码。)
在 1.8.13 版本中,我可以重现有关调用图的问题。在 1.8.14 版本中,这个错误的调用图消失了。
来自 doxygen 更改日志:函数定义后的函数声明被错误地列为调用依赖 [https://github.com/doxygen/doxygen/commit/436fc7ed1158d517dd6f6d25aa3e05568f8c3d94]