News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Plugin for cppcheck

Started by dwmcqueen, September 17, 2009, 05:01:13 PM

Previous topic - Next topic

dwmcqueen

Has anyone looked at developing a plugin for cppcheck?

stahta01

I am guessing no plugin exists.

Did you read this; might help you think of how to use cppcheck.

http://wiki.codeblocks.org/index.php?title=UnitTesting

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

dwmcqueen

I thought as much too.

As I understand it, cppcheck is not a testing framework but static code analysis - which might come in handy integrated into the CodeBlocks IDE. 

jfouche

I didn't know about CppCheck. I think it's a good idea. I began a plugin for CodeLite for it. If you need help, you can ask me (I created a lib and a base class to use CppCheck without a main).
--
Jérémie

killerbot

for completeness : CB now already has for some time a CppCheck plug-in :-)

oBFusCATed

killerbot: can I ask for two features in the CppCheck plugin:

1. I have a quad core and want to set the number of cores that cppcheck will use. This can be done with: "cppcheck -j n"
2. I've talked to cppcheck's devs and they've said that if cppcheck doesn't know some class/struct/type it ignores all usages of this type. Their advice was to use the -I option to replicate the project's (and compiler's) include dirs? Can you implement such mechanism?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

killerbot

good ideas.

I think I already add the include directories of the project.

oBFusCATed

If this are the executed commands:

cppcheck --version
Cppcheck 1.41
cppcheck --verbose --all --style --xml --file-list=CppCheckInput.txt

There are no -I options...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

gku

[push]
Is the -I switch still on any todo list?
I have some extra include dirs making troubles without the -I support.

I know, I know... I only use the forum when I have troubles - and never to give positive feedback  :D

killerbot

I completely forgot about that, thanks for reminding :-)

ironhead

Support for multiple cores would be nice as well. ;)

From what I remember though, in multi-core mode, not all checks work.

killerbot

Hi the support for the -I was in the code, as I thought it was. But there was a horrible stupid mistake (shame on me), al that was needed to fix, wa to put the '!' in the right spot ;-)  [empty versus !empty]

It could be there is still a minor issue, we the working directory, will look into that too.