加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

如何提供多个c文件作为GNU Cflow的输入?

发布时间:2020-12-13 19:06:08 所属栏目:Linux 来源:网络整理
导读:我能够使用gnu-cflow生成一个文件的调用图,但我无法找到如何使用cflow为多个文件生成调用图. 我试过跟随 cflow test.c,hello.c 它为test.c生成调用图,而不是为hello.c创建调用图 cflow test.c hello.c 它为hello.c生成调用图,而不是为test.c创建调用图 我不

我能够使用gnu-cflow生成一个文件的调用图,但我无法找到如何使用cflow为多个文件生成调用图.

我试过跟随

> cflow test.c,hello.c

它为test.c生成调用图,而不是为hello.c创建调用图
> cflow test.c hello.c

它为hello.c生成调用图,而不是为test.c创建调用图

我不知道如何将多个文件传递给cflow.

对此有何想法?

你好?

int
 who_am_i (void)
 {
     struct passwd *pw;
     char *user = NULL;

     pw = getpwuid (geteuid ());
     if (pw)
     user = pw->pw_name;
     else if ((user = getenv ("USER")) == NULL)
     {
         fprintf (stderr,"I don't know!n");
         return 1;
     }
     printf ("%sn",user);
     unused_function();
     return 0;
 }

 int
 main (int argc,char **argv)
 {
     if (argc > 1)
     {
         fprintf (stderr,"usage: whoamin");
         return 1;
     }
     return who_am_i ();
 }
 void unused_function()
 {
     printf();
     error1();
     printf();
 }
 void error1()
 {
     error2();
 }
 void error2()
 {

 }

test.c的

int tests()
{ return 0;}
最佳答案
> cflow test.c hello.c

实际上上面的语句是正确的,并且tests()没有出现在callgraph中,因为它从未被调用过.

@AndreasGrapentin给出了答案

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读