Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Calexus on September 20, 2011, 09:43:35 pm

Title: How does the cppcheck plugin find the cppcheck executable?
Post by: Calexus on September 20, 2011, 09:43:35 pm
How does the cppcheck plugin find the cppcheck executable?

I'm doing some testing of the latest (5458) on osx and I'm having some problem with cppcheck.

Output:

Quote
cppcheck --version
execvp(cppcheck, --version) failed with error 2!
switching working directory to : /test/
cppcheck --verbose --all --style --xml --file-list=CppCheckInput.txt
execvp(cppcheck, --verbose, --all, --style, --xml, --file-list=CppCheckInput.txt) failed with error 2!
Failed to parse cppcheck XML file.
Probably it's not produced correctly.

I'm guessing the plugin cant find the executable as even --version fails. Running cppcheck from a terminal the manual way works as it should.
Title: Re: How does the cppcheck plugin find the cppcheck executable?
Post by: killerbot on September 20, 2011, 09:51:12 pm
it requires the executable to be in your PATH.
Title: Re: How does the cppcheck plugin find the cppcheck executable?
Post by: oBFusCATed on September 20, 2011, 09:53:20 pm
Or asks you for the full path to the executable.

See here: http://svn.berlios.de/wsvn/codeblocks/trunk/src/plugins/contrib/CppCheck/CppCheck.cpp?peg=7458
in CppCheck::DoCppCheckVersion().
Title: Re: How does the cppcheck plugin find the cppcheck executable?
Post by: Calexus on September 20, 2011, 10:04:54 pm
Well I have it in my PATH, and use it frequently, and I was not asked about it's location so it must be something else. But as I run out of batteries I'm now back in windows so I'll have to wait until work tomorrow before I can continue.

But there are no settings or options regarding the cppcheck plugin, right? At least I could not find any.
Title: Re: How does the cppcheck plugin find the cppcheck executable?
Post by: oBFusCATed on September 20, 2011, 10:33:22 pm
No settings, as far as I know.

You can try to use strace (or the equivalent on MacOSX, dtrace I think) to see what is really happening.
Title: Re: How does the cppcheck plugin find the cppcheck executable?
Post by: Calexus on September 20, 2011, 10:38:11 pm
Never heard of dtrace, I'm kind of new to osx, but I'll give it a try.