Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: Jewest on February 14, 2014, 11:42:15 am

Title: Customize the CppCheck plugin call
Post by: Jewest 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
Title: Re: Customize the CppCheck plugin call
Post by: stahta01 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.
Title: Re: Customize the CppCheck plugin call
Post by: Jewest 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.
Title: Re: Customize the CppCheck plugin call
Post by: oBFusCATed 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.