是否有可能以比simply calling the shell command on the current buffer更復雜的方式整合Cppcheck和Emacs?我希望Emacs能夠解析Cppcheck的消息,並將它們視爲來自編譯器的消息(類似於compile
的工作方式),例如使用C-x`訪問Cppcheck消息的目標。將Cppcheck與Emacs集成
下面是一些例子輸出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
感謝。聽起來像一個合理的方法。有沒有可能以這種方式獲得幫助設置flymake? –
建議是免費的,但幫助很難得到呃? :)如果你能告訴我cppcheck的輸出是什麼樣的,我可能會提供一些幫助。 –
是的。我已經添加了一些示例輸出到我的問題。 –