gpt4 book ai didi

c - 典型的 C 和 C 预处理器重构

转载 作者:行者123 更新时间:2023-12-04 21:39:03 25 4
gpt4 key购买 nike

我正在为 C 开发一个带有预处理器支持的重构工具...我不知道大型 C 项目中涉及的重构类型,我想知道人们在重构 C 代码(和预处理器指令)时实际做了什么

我还想知道是否有一些真正有趣的功能没有出现在任何工具中,因此重构必须完全手动完成...例如,我已经看到 Xref 无法重构宏被用作迭代器(虽然不知道这到底是什么意思)...

谢谢

最佳答案

任何对此感兴趣的人(特定于 C),可能想看看 coccinelle tool :

Coccinelle is a program matching and transformation engine which provides the language SmPL (Semantic Patch Language) for specifying desired matches and transformations in C code. Coccinelle was initially targeted towards performing collateral evolutions in Linux. Such evolutions comprise the changes that are needed in client code in response to evolutions in library APIs, and may include modifications such as renaming a function, adding a function argument whose value is somehow context-dependent, and reorganizing a data structure. Beyond collateral evolutions, Coccinelle is successfully used (by us and others) for finding and fixing bugs in systems code.

关于c - 典型的 C 和 C 预处理器重构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/787861/

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