User forums > General (but related to Code::Blocks)
cppcheck not working
danilo2:
Additionl, cppcheck for following code does not return any errors also:
--- Code: ---#include <iostream>
using namespace std;
int main()
{
cout << "Hello world!" << endl
int* x = new int;
return 0;
}
--- End code ---
::)
oBFusCATed:
--- Quote from: danilo2 on November 16, 2012, 02:17:11 pm ---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?
--- End quote ---
Yes, press f9 constantly :)
For the other error, test with cppcheck run on the command line.
danilo2:
from the command line the cppcheck prints worning about memory leak - this is cool.
Do I really need to constantly recompile project to get know about errors? What if it is custom makefile project or its compilation take more than a few second?
Eclipse (which is horrbily slow) can check for errors while typing :(
Jenna:
You only need to (re-)build if you want to check for errors the compiler can find, but cppcheck not.
And it warns about memleak from inside C::B too, at least here, if you add the missing semicolon.
oBFusCATed:
--- Quote from: danilo2 on November 16, 2012, 02:48:06 pm ---Eclipse (which is horrbily slow) can check for errors while typing :(
--- End quote ---
It also runs the compiler, but does it behind your back. With C::B you have control. Probably in a future release we will add this feature, but currently it isn't available.
Navigation
[0] Message Index
[*] Previous page
Go to full version