gpt4 book ai didi

七星输出

转载 作者:行者123 更新时间:2023-12-02 01:35:42 25 4
gpt4 key购买 nike

我是 coccinelle 的初学者,并尝试运行我的第一个示例。

目前我正在遵循 this article 的步骤

  • 我创建了 c 文件
  • 我创建了 coccinelle 脚本
  • 我运行它使用
    $ spatch -sp_file test.cocci test.c

  • 在终端中,我得到了文章中提到的预期结果
    --- test.c
    +++ /tmp/cocci-output-17416-b5450d-test.c
    @@ -7,7 +7,7 @@ main(int argc, char *argv[])
    char *buf;

    /* allocate memory */
    - buf = alloca(bytes);
    + buf = malloc(bytes);

    return 0;
    }

    但是,c 文件没有按预期更改。

    任何机构都可以告诉我在哪里可以获得脚本所做的更改?

    最佳答案

    使用

    spatch --help

    我得到了命令 spatch 的所有选项。
    所以我应该使用
    $ spatch -sp_file test.cocci test.c -o /tmp/newtest.c

    运行补丁的结果在/tmp/newtest.c

    关于七星输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31338757/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com