User forums > General (but related to Code::Blocks)

cppcheck not working

(1/2) > >>

danilo2:
Hi!
I'm using Fedora 17 and I've installed codeblocks with plugins from my repo (it is 10.05 version).
When I'm trying to run cppcheck plugin I get error in console:

--- Code: ---cppcheck --version
Cppcheck 1.57
cppcheck --verbose --all --style --xml --file-list=CppCheckInput.txt
cppcheck: error: unrecognized command line option: "--all".
Failed to parse cppcheck XML file.
Probably it's not produced correctly.
--- End code ---

Is it a bug?

MortenMacFly:

--- Quote from: danilo2 on November 15, 2012, 12:52:58 pm ---Is it a bug?

--- End quote ---
No. Your CppCheck is too new or your C::B too old. So either you use an older CppCheck or a nightly of C::B.

danilo2:
Thank you, I've installed the newest version from trunk and these errors are gone, but there is other poblem.

When I input a sample (wrong code like this):

--- Code: ---#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!"s22 << endl
    dsad()
    return 0;
}

--- End code ---

and click plugins->cppcheck i get the output:

--- Code: ---cppcheck --version
Cppcheck 1.57
Switching working directory to : /home/[username]/dev/test/
cppcheck --verbose --enable=all --enable=style --xml --file-list=CppCheckInput.txt
Checking main.cpp...
Checking usage of global functions..
<?xml version="1.0" encoding="UTF-8"?>
<results>
</results>
--- End code ---

And nothing happens - no lines are underscored I see no notifications etc - how can I make this plugin running? :(

oBFusCATed:
Why do you think you'll get a notification for this code?
Check the documentation of CppCheck for the list supported errors detected by it.

Probably you can try "int *a=new int;" and don't put the delete there or "int *a=new int; delete [] a;"

danilo2:
Thank you,
I was thinking that cppcheck will check for any syntax error too. Is it possible to get notifications about such errors like no semicolon on end of the line or undeclared property usage?

Navigation

[0] Message Index

[#] Next page

Go to full version