【发布时间】:2012-06-29 09:46:43
【问题描述】:
是否可以以比simply calling the shell command on the current buffer 更复杂的方式将 Cppcheck 与 Emacs 集成?我希望 Emacs 能够解析 Cppcheck 的消息并将它们视为来自编译器的消息(类似于 compile 的工作方式),例如使用 C-x ` 访问 Cppcheck 消息的目标。
这是一些示例输出 Cppcheck:
$ cppcheck --enable=all test.cpp
Checking test.cpp...
[test.cpp:4]: (error) Possible null pointer dereference: p - otherwise it is redundant to check if p is null at line 5
[test.cpp:38]: (style) The scope of the variable 'i' can be reduced
[test.cpp:38]: (style) Variable 'i' is assigned a value that is never used
[test.cpp:23]: (error) Possible null pointer dereference: p
[test.cpp:33]: (error) Possible null pointer dereference: p
Checking usage of global functions..
[test.cpp:36]: (style) The function 'f' is never used
[test.cpp:1]: (style) The function 'f1' is never used
[test.cpp:9]: (style) The function 'f2' is never used
[test.cpp:26]: (style) The function 'f3' is never used
【问题讨论】: