Author Topic: Customize the CppCheck plugin call  (Read 8259 times)

Offline Jewest

  • Multiple posting newcomer
  • *
  • Posts: 31
Customize the CppCheck plugin call
« on: February 14, 2014, 11:42:15 am »
Hi,

I just discovered the cppcheck plugin.
Love it but the calling parameters are too big for my taste.
For a project I need to use some part of the QT project but I use the normal gcc compiler and C::B and not Qmake.
When I run the CppCheck plugin, it includes all the QT sub dirs in the project configuration.
Is there a way to disable this? (except starting it by hand)

I am talking about:
/usr/include/qt4/QtXml
/usr/include/qt4/QtCore
/usr/include/qt4/

Using debian unstable x64.
(like the improvements between C::B 12 and C::B 13)

Thanks in advance,

Jewest

Online stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Customize the CppCheck plugin call
« Reply #1 on: February 14, 2014, 12:06:53 pm »
This would normally be a bad thing too do; but, it might be a quick fix/workaround for your issue.

Using the Compiler Plugin Copy the "gcc" Compiler to something like "gcc for QT projects"
Exit Code::Block; Warning CB has a design feature the Compiler Copies/Renames are best followed by exiting Code::Blocks to prevent losing work.

Move the QT related project includes for your project to the "gcc for QT projects" compiler.

Try changing your project to use the "gcc for QT projects" compiler"

This might fix the issue; I DO NOT use the cppcheck plugin, right now.

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

Offline Jewest

  • Multiple posting newcomer
  • *
  • Posts: 31
Re: Customize the CppCheck plugin call
« Reply #2 on: August 15, 2014, 02:12:52 pm »
I just checked the argument list of the CPPChecker.
If I could change the options to only the files used in the project, in other words just --file-list= cppcheckinput.txt.
I think this is what everybody wants, to check your own project and not the external libs.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Customize the CppCheck plugin call
« Reply #3 on: August 15, 2014, 09:20:24 pm »
I think you're misunderstanding the purpose of the options.
C::B automatically passes the include files taken from your project in order to allow cppcheck to know about the classes and struct from qt.
If cppcheck doesn't know about something it skips the code using it.
So if you have a code using types, functions coming from QT, then this code won't be checked for errors.
(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!]