Author Topic: Plugin for cppcheck  (Read 13203 times)

Offline dwmcqueen

  • Multiple posting newcomer
  • *
  • Posts: 56
Plugin for cppcheck
« on: September 17, 2009, 05:01:13 pm »
Has anyone looked at developing a plugin for cppcheck?

Online stahta01

  • Lives here!
  • ****
  • Posts: 6736
    • My Best Post
Re: Plugin for cppcheck
« Reply #1 on: September 17, 2009, 06:33:51 pm »
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++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline dwmcqueen

  • Multiple posting newcomer
  • *
  • Posts: 56
Re: Plugin for cppcheck
« Reply #2 on: September 17, 2009, 08:03:40 pm »
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. 

Offline jfouche

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: Plugin for cppcheck
« Reply #3 on: September 18, 2009, 04:07:10 pm »
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

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5209
Re: Plugin for cppcheck
« Reply #4 on: January 27, 2010, 10:08:24 pm »
for completeness : CB now already has for some time a CppCheck plug-in :-)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12201
    • Travis build status
Re: Plugin for cppcheck
« Reply #5 on: May 06, 2010, 05:09:16 am »
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!]

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5209
Re: Plugin for cppcheck
« Reply #6 on: May 06, 2010, 07:03:42 am »
good ideas.

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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12201
    • Travis build status
Re: Plugin for cppcheck
« Reply #7 on: May 06, 2010, 01:44:27 pm »
If this are the executed commands:
Code: [Select]
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!]

Offline gku

  • Single posting newcomer
  • *
  • Posts: 6
Re: Plugin for cppcheck
« Reply #8 on: August 25, 2010, 06:23:53 pm »
[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

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5209
Re: Plugin for cppcheck
« Reply #9 on: August 25, 2010, 06:46:10 pm »
I completely forgot about that, thanks for reminding :-)

Offline ironhead

  • Almost regular
  • **
  • Posts: 210
Re: Plugin for cppcheck
« Reply #10 on: September 01, 2010, 12:33:50 pm »
Support for multiple cores would be nice as well. ;)

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

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5209
Re: Plugin for cppcheck
« Reply #11 on: October 01, 2010, 01:10:03 pm »
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.