c++ 从命令行自动应用Clang的修复提示

nwsw7zdq  于 11个月前  发布在  其他
关注(0)|答案(2)|浏览(159)

Clang(和GCC)编译错误可以附带如何修复它们的建议:“Fix-it Hints”。Clang(或者其他LLVM工具)是否有一个选项可以应用这些提示?我在https://clang.llvm.org/docs/UsersManual.html中没有看到一个。显然这样的程序可以使用-fdiagnostics-parseable-fixits编写;这不是我要问的。

oipij1gg

oipij1gg1#

是的

-fix-only-warnings      Apply fix-it advice only for warnings, not errors
 -fix-what-you-can       Apply fix-it advice even in the presence of unfixable errors
 -fixit-recompile        Apply fix-it changes and recompile
 -fixit-to-temporary     Apply fix-it changes to temporary files
 -fixit=<value>          Apply fix-it advice creating a file with the given suffix
 -fixit                  Apply fix-it advice to the input source

字符串

zpgglvta

zpgglvta2#

如果你想知道,像我一样,在哪里可以找到在接受的答案中给出的帮助:

clang -cc1 --help | grep -- -fix

字符串

相关问题