cppcheck/todo.txt

120 lines
1.6 KiB
Plaintext

Tokens..
I think the SimplifyTokens function should insert braces after every if/for/while.
That would make the token list easier to parse.
Userdefined types
I think this needs to be handled better.
Unused function / variable
Check if all members in the public section of a class
are used externally.
Dead pointers
Check for dead pointers
Style
Increase constness
Function parameters: Use std::ostream instead of std::ostringstream or std::ofstream
Optimisation: Return "const _T &" instead of "_T"?
Unused variable (function, file, class), unused value, unused parameter
operator= should initialize all class members
MEMORY LEAKS
============
Better checking of pointers in structs
User configurable.
void f()
{
struct ABC *abc;
try
{
abc = new ABC;
abc->a = new char[10];
delete [] abc->a;
delete abc;
}
catch (...) {}
}
void f1()
{
while (true)
{
struct ABC *abc = new ABC;
abc->a = new char[10];
if ( ! abc->a )
break;
delete [] abc->a;
delete abc;
break;
}
}
void f2()
{
for (;;)
{
struct ABC *abc = new ABC;
abc->a = new char[10];
if ( ! abc->a )
break;
delete [] abc->a;
delete abc;
break;
}
}
void foo()
{
struct ABC *abc = new ABC;
abc->a = new char[10];
if ( ! abc->a )
goto end;
delete [] abc->a;
delete abc;
end:
}