Removed 'bugs_that_cppcheck_finds'. It will be listed in the wiki instead

This commit is contained in:
Daniel Marjamäki 2008-04-14 06:24:45 +00:00
parent 53f078fc1d
commit e09d61180d
1 changed files with 0 additions and 59 deletions

View File

@ -1,59 +0,0 @@
List of bugs that c++check finds
This is very incomplete.
Buffer overrun:
// using numeric array index
char str[100];
str[100] = 0;
// using constant array index
char str2[SIZE];
str[SIZE] = 0;
// Calculating array index with constants and numbers
int i[100];
i[sizeof(i)-1] = 0;
// In some cases, it's detected when a variable causes buffer overrun:
char str[100];
for (int i = 0; i <= 100; i++)
str[i] = 0;
// Using 'strcpy' and 'strcat' can result in buffer overrun..
char str[3];
strcpy(str, "abc");
Memory leaks:
// No deallocation at all
{
Fred *fred = new Fred;
}
// Mismatching allocation / deallocation
char *str = new char[10];
delete str; // Should be 'delete [] str'
// An execution path may prevent a variable from being deallocated:
char *str = new char[10];
if (ab == cd)
return; // or 'continue' or 'break'
Class constructors:
Check that all member variables are initialized.
Check that all private member functions are used.